diff options
author | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-13 13:20:55 +0000 |
---|---|---|
committer | cdgill <cdgill@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-13 13:20:55 +0000 |
commit | e28a803d657c91b5eb63e1705ba3853dd29670d2 (patch) | |
tree | 9f478ab0bb14816f9a0e1f58a9da2ad96a83ad8b /TAO/orbsvcs/orbsvcs/Sched | |
parent | 1d38cd8a23b72dbaf96af62b983df9e810b09c7b (diff) | |
download | ATCD-e28a803d657c91b5eb63e1705ba3853dd29670d2.tar.gz |
Added accessors for internal trees, maps, and counts
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Sched')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp | 91 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h | 94 |
2 files changed, 156 insertions, 29 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp index 58aad264dcb..b21e54d4e49 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp @@ -1427,6 +1427,97 @@ TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::init_rt_info (RtecSch rt_info.volatile_token = 0; } + +// Accesses scheduling strategy for the reconfig scheduler. + +template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> RECONFIG_SCHED_STRATEGY & +TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::sched_strategy () +{ + return this->sched_strategy_; +} + + +// Accesses map for O(1) lookup of Config_Infos by priority level. + +template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> +ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::CONFIG_INFO_MAP & +TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::config_info_map () +{ + return this->config_info_map_; +} + + +// Returns the number of config infos, which is also the number of +// assigned priority levels. + +template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> long +TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::config_info_count () +{ + return this->config_info_count_; +} + + +// Accesses map for O(1) lookup of RT_Infos by handle. + +template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> +ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_MAP & +TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::rt_info_map () +{ + return this->rt_info_map_; +} + + +// Returns the number of registered RT_Infos. + +template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> long +TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::rt_info_count () +{ + return this->rt_info_count_; +} + + +// Accesses tree for O(log n) lookup of RT_Infos by name. + +template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> +ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::RT_INFO_TREE & +TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::rt_info_tree () +{ + return this->rt_info_tree_; +} + + +// Accesses map for O(1) lookup of RT_Info dependency +// set by the caller operation's handle. + +template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> +ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & +TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::calling_dependency_set_map () +{ + return this->calling_dependency_set_map_; +} + + +// Accesses map for O(1) lookup of RT_Info dependency +// set by the called operation's handle. + +template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> +ACE_TYPENAME TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::DEPENDENCY_SET_MAP & +TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::called_dependency_set_map () +{ + return this->called_dependency_set_map_; +} + + +// Returns the number of dependencies in the dependency lists of all RT_Infos. +// This is used when traversing the dependency graph. + +template <class RECONFIG_SCHED_STRATEGY, class ACE_LOCK> int +TAO_Reconfig_Scheduler<RECONFIG_SCHED_STRATEGY, ACE_LOCK>::dependency_count () +{ + return this->dependency_count_; +} + + #endif /* __GNUC__ */ #endif /* TAO_RECONFIG_SCHEDULER_T_C */ diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h index e02bd22b12e..caf527cf57f 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h +++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.h @@ -49,6 +49,34 @@ class TAO_Reconfig_Scheduler : { public: + typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t, + RtecScheduler::RT_Info*, + ACE_Hash<RtecScheduler::handle_t>, + ACE_Equal_To<RtecScheduler::handle_t>, + ACE_LOCK> RT_INFO_MAP; + // Type of map used for O(1) lookup of RT_Infos by their handles. + + typedef ACE_RB_Tree<const char *, + RtecScheduler::RT_Info*, + ACE_Less_Than<const char *>, + ACE_LOCK> RT_INFO_TREE; + // Type of tree used for O(log n) lookup of RT_Infos by their names. + + typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::Preemption_Priority_t, + RtecScheduler::Config_Info*, + ACE_Hash<RtecScheduler::Preemption_Priority_t>, + ACE_Equal_To<RtecScheduler::Preemption_Priority_t>, + ACE_LOCK> CONFIG_INFO_MAP; + // Type of map used for O(1) lookup of Config_Infos by their priorities. + + typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t, + RtecScheduler::Dependency_Set*, + ACE_Hash<RtecScheduler::handle_t>, + ACE_Equal_To<RtecScheduler::handle_t>, + ACE_LOCK> DEPENDENCY_SET_MAP; + // Type of map used for O(1) lookup of RT_Info + // dependency sets by caller or called handle. + TAO_Reconfig_Scheduler (int enforce_schedule_stability = 0); // Default constructor. @@ -198,6 +226,39 @@ public: // of scheduled priorities. All scheduled priorities range from 0 // to the number returned, inclusive. + // = Accessors that allow controlled relaxations of encapsulation. + + RECONFIG_SCHED_STRATEGY & sched_strategy (); + // Accesses scheduling strategy for the reconfig scheduler. + + CONFIG_INFO_MAP & config_info_map (); + // Accesses map for O(1) lookup of Config_Infos by priority level. + + long config_info_count (); + // Returns the number of config infos, which is also the number of + // assigned priority levels. + + RT_INFO_MAP & rt_info_map (); + // Accesses map for O(1) lookup of RT_Infos by handle. + + long rt_info_count (); + // Returns the number of registered RT_Infos. + + RT_INFO_TREE & rt_info_tree (); + // Accesses tree for O(log n) lookup of RT_Infos by name. + + DEPENDENCY_SET_MAP & calling_dependency_set_map (); + // Accesses map for O(1) lookup of RT_Info dependency + // set by the caller operation's handle. + + DEPENDENCY_SET_MAP & called_dependency_set_map (); + // Accesses map for O(1) lookup of RT_Info dependency + // set by the called operation's handle. + + int dependency_count (); + // Returns the number of dependencies in the dependency lists of all RT_Infos. + // This is used when traversing the dependency graph. + protected: // @@ TO DO: use a memento to save and restore scheduler state without @@ -229,34 +290,6 @@ protected: }; // Flags indicating stability conditions of schedule. - typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t, - RtecScheduler::RT_Info*, - ACE_Hash<RtecScheduler::handle_t>, - ACE_Equal_To<RtecScheduler::handle_t>, - ACE_LOCK> RT_INFO_MAP; - // Type of map used for O(1) lookup of RT_Infos by their handles. - - typedef ACE_RB_Tree<const char *, - RtecScheduler::RT_Info*, - ACE_Less_Than<const char *>, - ACE_LOCK> RT_INFO_TREE; - // Type of tree used for O(log n) lookup of RT_Infos by their names. - - typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::Preemption_Priority_t, - RtecScheduler::Config_Info*, - ACE_Hash<RtecScheduler::Preemption_Priority_t>, - ACE_Equal_To<RtecScheduler::Preemption_Priority_t>, - ACE_LOCK> CONFIG_INFO_MAP; - // Type of map used for O(1) lookup of Config_Infos by their priorities. - - typedef ACE_Hash_Map_Manager_Ex<RtecScheduler::handle_t, - RtecScheduler::Dependency_Set*, - ACE_Hash<RtecScheduler::handle_t>, - ACE_Equal_To<RtecScheduler::handle_t>, - ACE_LOCK> DEPENDENCY_SET_MAP; - // Type of map used for O(1) lookup of RT_Info - // dependency sets by caller or called handle. - virtual RtecScheduler::RT_Info * create_i (const char * entry_point, RtecScheduler::handle_t handle, CORBA::Environment &_env) @@ -359,6 +392,9 @@ protected: // Helper method to give an RT_Info some reasonable default values + + // = Protected class members. + RECONFIG_SCHED_STRATEGY sched_strategy_; // Scheduling strategy for the reconfig scheduler. @@ -376,7 +412,7 @@ protected: // The number of registered RT_Infos. RT_INFO_TREE rt_info_tree_; - // Map for O(1) lookup of RT_Infos by handle. + // Tree for O(log n) lookup of RT_Infos by name. DEPENDENCY_SET_MAP calling_dependency_set_map_; // Map for O(1) lookup of RT_Info dependency |