diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-01-12 08:46:25 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-01-12 08:46:25 +0000 |
commit | 5402ea3d285c642f5ee3e9ad8e270f7b910c2d64 (patch) | |
tree | 466bf482a846cd2e21fc96575bc4bede2d27f077 /ACE | |
parent | d717844a53ac7858d2971922f984e778c5937679 (diff) | |
download | ATCD-5402ea3d285c642f5ee3e9ad8e270f7b910c2d64.tar.gz |
Mon Jan 12 08:45:46 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/Default_Constants.h:
Added ACE_DEFAULT_SERVICE_GESTALT_SIZE which defaults to 1024
* ace/Service_Gestalt.cpp:
Doxygen changes
* ace/Service_Gestalt.h:
Use ACE_DEFAULT_SERVICE_GESTALT_SIZE instead of the hardcoded
default of 1024. Also made some doxygen changes
Diffstat (limited to 'ACE')
-rw-r--r-- | ACE/ChangeLog | 12 | ||||
-rw-r--r-- | ACE/ace/Default_Constants.h | 4 | ||||
-rw-r--r-- | ACE/ace/Service_Gestalt.cpp | 49 | ||||
-rw-r--r-- | ACE/ace/Service_Gestalt.h | 34 |
4 files changed, 54 insertions, 45 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index d83078204c3..85860440a88 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,15 @@ +Mon Jan 12 08:45:46 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> + + * ace/Default_Constants.h: + Added ACE_DEFAULT_SERVICE_GESTALT_SIZE which defaults to 1024 + + * ace/Service_Gestalt.cpp: + Doxygen changes + + * ace/Service_Gestalt.h: + Use ACE_DEFAULT_SERVICE_GESTALT_SIZE instead of the hardcoded + default of 1024. Also made some doxygen changes + Mon Jan 12 08:16:46 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> * bin/tao_orb_tests.lst: diff --git a/ACE/ace/Default_Constants.h b/ACE/ace/Default_Constants.h index ce435121681..61369d3d158 100644 --- a/ACE/ace/Default_Constants.h +++ b/ACE/ace/Default_Constants.h @@ -62,6 +62,10 @@ #define ACE_DEFAULT_SERVICE_REPOSITORY_SIZE 1024 #endif /* ACE_DEFAULT_SERVICE_REPOSITORY_SIZE */ +#if !defined (ACE_DEFAULT_SERVICE_GESTALT_SIZE) +#define ACE_DEFAULT_SERVICE_GESTALT_SIZE 1024 +#endif /* ACE_DEFAULT_SERVICE_GESTALT_SIZE */ + #if !defined (ACE_REACTOR_NOTIFICATION_ARRAY_SIZE) #define ACE_REACTOR_NOTIFICATION_ARRAY_SIZE 1024 #endif /* ACE_REACTOR_NOTIFICATION_ARRAY_SIZE */ diff --git a/ACE/ace/Service_Gestalt.cpp b/ACE/ace/Service_Gestalt.cpp index 8b4302850e4..4ebe7de5376 100644 --- a/ACE/ace/Service_Gestalt.cpp +++ b/ACE/ace/Service_Gestalt.cpp @@ -74,7 +74,6 @@ ACE_Service_Type_Dynamic_Guard::ACE_Service_Type_Dynamic_Guard /// Destructor - ACE_Service_Type_Dynamic_Guard::~ACE_Service_Type_Dynamic_Guard (void) { const ACE_Service_Type *tmp = 0; @@ -290,9 +289,8 @@ ACE_Service_Gestalt::init_i (void) } -// Add the default statically-linked services to the Service -// Repository. - +/// Add the default statically-linked services to the Service +/// Repository. int ACE_Service_Gestalt::load_static_svcs (void) { @@ -318,7 +316,6 @@ ACE_Service_Gestalt::load_static_svcs (void) /// Find a static service descriptor by name - int ACE_Service_Gestalt::find_static_svc_descriptor (const ACE_TCHAR* name, ACE_Static_Svc_Descriptor **ssd) const @@ -346,7 +343,6 @@ ACE_Service_Gestalt::find_static_svc_descriptor (const ACE_TCHAR* name, } /// @brief - const ACE_Static_Svc_Descriptor* ACE_Service_Gestalt::find_processed_static_svc (const ACE_TCHAR* name) { @@ -372,7 +368,6 @@ ACE_Service_Gestalt::find_processed_static_svc (const ACE_TCHAR* name) /// /// This is part of the mechanism ensuring distinct local instances /// for static service objects, loaded in another repository. - void ACE_Service_Gestalt::add_processed_static_svc (const ACE_Static_Svc_Descriptor *assd) @@ -449,10 +444,6 @@ ACE_Service_Gestalt::dump (void) const #endif /* ACE_HAS_DUMP */ } - - -/// - int ACE_Service_Gestalt::initialize (const ACE_TCHAR *svc_name, const ACE_TCHAR *parameters) @@ -602,17 +593,16 @@ ACE_Service_Gestalt::initialize (const ACE_Service_Type_Factory *stf, #endif /* (ACE_USES_CLASSIC_SVC_CONF == 1) */ -// Dynamically link the shared object file and retrieve a pointer to -// the designated shared object in this file. -// @note This is obsolete (and error-prone) in the presense of dynamic -// services with their own static services. This method will allow those -// static services to register *before* the dynamic service that owns them. -// Upon finalization of the static services the process may crash, because -// the dynamic service's DLL may have been already released, together with -// the memory in which the static services reside. -// It may not crash, for instance, when the first static service to register -// is the same as the dynamic service being loaded. You should be so lucky! .. - +/// Dynamically link the shared object file and retrieve a pointer to +/// the designated shared object in this file. +/// @note This is obsolete (and error-prone) in the presense of dynamic +/// services with their own static services. This method will allow those +/// static services to register *before* the dynamic service that owns them. +/// Upon finalization of the static services the process may crash, because +/// the dynamic service's DLL may have been already released, together with +/// the memory in which the static services reside. +/// It may not crash, for instance, when the first static service to register +/// is the same as the dynamic service being loaded. You should be so lucky! .. int ACE_Service_Gestalt::initialize (const ACE_Service_Type *sr, const ACE_TCHAR *parameters) @@ -644,8 +634,8 @@ ACE_Service_Gestalt::initialize (const ACE_Service_Type *sr, } -// Dynamically link the shared object file and retrieve a pointer to -// the designated shared object in this file. +/// Dynamically link the shared object file and retrieve a pointer to +/// the designated shared object in this file. int ACE_Service_Gestalt::initialize_i (const ACE_Service_Type *sr, const ACE_TCHAR *parameters) @@ -703,12 +693,11 @@ ACE_Service_Gestalt::remove (const ACE_TCHAR svc_name[]) return this->repo_->remove (svc_name); } -// Suspend <svc_name>. Note that this will not unlink the service -// from the daemon if it was dynamically linked, it will mark it as -// being suspended in the Service Repository and call the <suspend> -// member function on the appropriate <ACE_Service_Object>. A service -// can be resumed later on by calling the <resume> method... - +/// Suspend @a svc_name. Note that this will not unlink the service +/// from the daemon if it was dynamically linked, it will mark it as +/// being suspended in the Service Repository and call the <suspend> +/// member function on the appropriate <ACE_Service_Object>. A service +/// can be resumed later on by calling the <resume> method... int ACE_Service_Gestalt::suspend (const ACE_TCHAR svc_name[]) { diff --git a/ACE/ace/Service_Gestalt.h b/ACE/ace/Service_Gestalt.h index 55b9e1c4db5..569269c614a 100644 --- a/ACE/ace/Service_Gestalt.h +++ b/ACE/ace/Service_Gestalt.h @@ -82,10 +82,15 @@ public: MAX_SERVICES = ACE_DEFAULT_SERVICE_REPOSITORY_SIZE }; + enum + { + DEFAULT_SIZE = ACE_DEFAULT_SERVICE_GESTALT_SIZE + }; + /// Constructor either associates the instance with the process-wide /// singleton instance of ACE_Service_Repository, or creates and /// manages its own instance of the specified size. - ACE_Service_Gestalt (size_t size = 1024, + ACE_Service_Gestalt (size_t size = DEFAULT_SIZE, bool svc_repo_is_owned = true, bool no_static_svcs = true); @@ -102,13 +107,13 @@ public: * is typically either a STREAM pipe or a socket address. If * @a ignore_static_svcs is true then static services are not loaded, * otherwise, they are loaded. If @a ignore_default_svc_conf_file is - * true then the <svc.conf> configuration file will be ignored. + * true then the @c svc.conf configuration file will be ignored. * Returns zero upon success, -1 if the file is not found or cannot * be opened (errno is set accordingly), otherwise returns the * number of errors encountered loading the services in the * specified svc.conf configuration file. If @a ignore_debug_flag is * true then the application is responsible for setting the - * <ACE_Log_Msg::priority_mask> appropriately. + * ACE_Log_Msg::priority_mask appropriately. */ int open (const ACE_TCHAR program_name[], const ACE_TCHAR *logger_key = ACE_DEFAULT_LOGGER_KEY, @@ -217,7 +222,7 @@ public: /** * Handle the command-line options intended for the - * ACE_Service_Gestalt. Note that <argv[0]> is assumed to be the + * ACE_Service_Gestalt. Note that @c argv[0] is assumed to be the * program name. * * The arguments that are valid in a call to this method are @@ -242,11 +247,10 @@ public: int process_directives (bool ignore_default_svc_conf_file); /// Tidy up and perform last rites when ACE_Service_Config is shut - /// down. This method calls <close_svcs>. Returns 0. + /// down. This method calls @c close_svcs. Returns 0. int close (void); - - // Registers a service descriptor for a static service object + /// Registers a service descriptor for a static service object int insert (ACE_Static_Svc_Descriptor *stsd); // = Utility methods. @@ -288,9 +292,9 @@ public: /** * Suspend @a svc_name. Note that this will not unlink the service * from the daemon if it was dynamically linked, it will mark it as - * being suspended in the Service Repository and call the <suspend> + * being suspended in the Service Repository and call the @c suspend() * member function on the appropriate ACE_Service_Object. A - * service can be resumed later on by calling the <RESUME> member + * service can be resumed later on by calling the @c resume() member * function... */ int suspend (const ACE_TCHAR svc_name[]); @@ -338,7 +342,7 @@ protected: bool ignore_default_svc_conf_file = false, bool ignore_debug_flag = false); - /// Initialize the <svc_conf_file_queue_> if necessary. + /// Initialize the @c svc_conf_file_queue_ if necessary. int init_svc_conf_file_queue (void); /// Add the default statically-linked services to the @@ -380,12 +384,12 @@ protected: protected: - // Maintain a queue of services to be configured from the - // command-line. + /// Maintain a queue of services to be configured from the + /// command-line. typedef ACE_Unbounded_Queue<ACE_TString> ACE_SVC_QUEUE; typedef ACE_Unbounded_Queue_Iterator<ACE_TString> ACE_SVC_QUEUE_ITERATOR; - // Maintain a set of the statically linked service descriptors. + /// Maintain a set of the statically linked service descriptors. typedef ACE_Unbounded_Set<ACE_Static_Svc_Descriptor *> ACE_STATIC_SVCS; @@ -431,7 +435,8 @@ protected: /// Queue of services specified on the command-line. ACE_SVC_QUEUE* svc_queue_; - /** Queue of svc.conf files specified on the command-line. + /** + * Queue of svc.conf files specified on the command-line. * @@ This should probably be made to handle unicode filenames... */ ACE_SVC_QUEUE* svc_conf_file_queue_; @@ -491,7 +496,6 @@ private: size_t repo_begin_; ACE_TCHAR const * const name_; - # if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) ACE_Guard< ACE_Recursive_Thread_Mutex > repo_monitor_; #endif |