Service_Config.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // $Id: Service_Config.inl 77337 2007-02-22 18:55:20Z iliyan $
00004 
00005 #include "ace/OS_NS_string.h"
00006 
00007 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00008 
00009 // This is the primary entry point into the ACE_Service_Config (the
00010 // constructor just handles simple initializations).
00011 
00012 ACE_INLINE int
00013 ACE_Service_Config::open (const ACE_TCHAR program_name[],
00014                           const ACE_TCHAR *logger_key,
00015                           bool ignore_static_svcs,
00016                           bool ignore_default_svc_conf,
00017                           bool ignore_debug_flag)
00018 {
00019   ACE_TRACE ("ACE_Service_Config::open");
00020   return ACE_Service_Config::current()->open (program_name,
00021                                               logger_key,
00022                                               ignore_static_svcs,
00023                                               ignore_default_svc_conf,
00024                                               ignore_debug_flag);
00025 }
00026 
00027 
00028 ACE_INLINE int
00029 ACE_Service_Config::open (int argc,
00030                           ACE_TCHAR *argv[],
00031                           const ACE_TCHAR *logger_key,
00032                           bool ignore_static_svcs,
00033                           bool ignore_default_svc_conf,
00034                           bool ignore_debug_flag)
00035 {
00036   ACE_TRACE ("ACE_Service_Config::open");
00037   return ACE_Service_Config::current()->open (argc,
00038                                               argv,
00039                                               logger_key,
00040                                               ignore_static_svcs,
00041                                               ignore_default_svc_conf,
00042                                               ignore_debug_flag);
00043 }
00044 
00045 // Handle the command-line options intended for the
00046 // ACE_Service_Config.
00047 
00048 ACE_INLINE int
00049 ACE_Service_Config::parse_args (int argc, ACE_TCHAR *argv[])
00050 {
00051   return ACE_Service_Config::current ()->parse_args (argc, argv);
00052 }
00053 
00054 
00055 /// Return the configuration instance, considered "global" in the
00056 /// current thread. This may be the same as instance(), but on some
00057 /// occasions, it may be a different one. For example,
00058 /// ACE_Service_Config_Guard provides a way of temporarily replacing
00059 /// the "current" configuration instance in the context of a thread.
00060 ACE_INLINE ACE_Service_Gestalt *
00061 ACE_Service_Config::instance (void)
00062 {
00063   return ACE_Service_Config::global ()->tss_;
00064 }
00065 
00066 
00067 /// Return the configuration instance, considered "global" in the
00068 /// current thread. This may be the same as instance(), but on some
00069 /// occasions, it may be a different one. For example,
00070 /// ACE_Service_Config_Guard provides a way of temporarily replacing
00071 /// the "current" configuration instance in the context of a thread.
00072 ACE_INLINE ACE_Service_Gestalt *
00073 ACE_Service_Config::current (void)
00074 {
00075   return ACE_Service_Config::global ()->tss_;
00076 }
00077 
00078 /// A mutator to set the "current" (TSS) gestalt instance.
00079 ACE_INLINE ACE_Service_Gestalt*
00080 ACE_Service_Config::current (ACE_Service_Gestalt *newcurrent)
00081 {
00082   return ACE_Service_Config::global ()->tss_.ts_object (newcurrent);
00083 }
00084 
00085 
00086 // Compare two service descriptors for equality.
00087 
00088 ACE_INLINE bool
00089 ACE_Static_Svc_Descriptor::operator== (ACE_Static_Svc_Descriptor &d) const
00090 {
00091   return ACE_OS::strcmp (name_, d.name_) == 0;
00092 }
00093 
00094 // Compare two service descriptors for inequality.
00095 
00096 ACE_INLINE bool
00097 ACE_Static_Svc_Descriptor::operator!= (ACE_Static_Svc_Descriptor &d) const
00098 {
00099   return !(*this == d);
00100 }
00101 
00102 ACE_INLINE void
00103 ACE_Service_Config::signal_handler (ACE_Sig_Adapter *signal_handler)
00104 {
00105   signal_handler_ = signal_handler;
00106 }
00107 
00108 // Initialize and activate a statically linked service.
00109 
00110 ACE_INLINE int
00111 ACE_Service_Config::initialize (const ACE_TCHAR *svc_name,
00112                                 const ACE_TCHAR *parameters)
00113 {
00114   ACE_TRACE ("ACE_Service_Config::initialize");
00115   return ACE_Service_Config::current ()->initialize (svc_name,
00116                                                      parameters);
00117 }
00118 
00119 // Dynamically link the shared object file and retrieve a pointer to
00120 // the designated shared object in this file.
00121 
00122 ACE_INLINE int
00123 ACE_Service_Config::initialize (const ACE_Service_Type *sr,
00124                                 const ACE_TCHAR *parameters)
00125 {
00126   ACE_TRACE ("ACE_Service_Config::initialize");
00127   return ACE_Service_Config::current ()->initialize (sr,
00128                                                      parameters);
00129 }
00130 
00131 /// Process a file containing a list of service configuration
00132 /// directives.
00133 ACE_INLINE int ACE_Service_Config::process_file (const ACE_TCHAR file[])
00134 {
00135   return ACE_Service_Config::current ()->process_file (file);
00136 }
00137 
00138 ///
00139 ACE_INLINE int
00140 ACE_Service_Config::process_directive (const ACE_TCHAR directive[])
00141 {
00142   return ACE_Service_Config::current ()->process_directive (directive);
00143 }
00144 
00145 // Process service configuration requests as indicated in the queue of
00146 // svc.conf files.
00147 ACE_INLINE int
00148 ACE_Service_Config::process_directives (void)
00149 {
00150   return ACE_Service_Config::current ()->process_directives ();
00151 }
00152 
00153 ACE_INLINE int
00154 ACE_Service_Config::process_directive (const ACE_Static_Svc_Descriptor &ssd,
00155                                        int force_replace)
00156 {
00157   return ACE_Service_Config::current ()->process_directive (ssd,
00158                                                             force_replace);
00159 }
00160 
00161 
00162 #if defined (ACE_HAS_WINCE) && defined (ACE_USES_WCHAR)
00163 // We must provide these function to bridge Svc_Conf parser with ACE.
00164 
00165 ACE_INLINE int
00166 ACE_Service_Config::initialize (const ACE_Service_Type *sp, ACE_ANTI_TCHAR parameters[])
00167 {
00168   return ACE_Service_Config::initialize (sp, ACE_TEXT_ANTI_TO_TCHAR (parameters));
00169 }
00170 
00171 ACE_INLINE int
00172 ACE_Service_Config::initialize (const ACE_ANTI_TCHAR svc_name[], ACE_ANTI_TCHAR parameters[])
00173 {
00174   return ACE_Service_Config::initialize (ACE_TEXT_ANTI_TO_TCHAR (svc_name),
00175                                          ACE_TEXT_ANTI_TO_TCHAR (parameters));
00176 }
00177 
00178 ACE_INLINE int
00179 ACE_Service_Config::resume (const ACE_ANTI_TCHAR svc_name[])
00180 {
00181   return ACE_Service_Config::resume (ACE_TEXT_ANTI_TO_TCHAR (svc_name));
00182 }
00183 
00184 ACE_INLINE int
00185 ACE_Service_Config::suspend (const ACE_ANTI_TCHAR svc_name[])
00186 {
00187   return ACE_Service_Config::suspend (ACE_TEXT_ANTI_TO_TCHAR (svc_name));
00188 }
00189 
00190 ACE_INLINE int
00191 ACE_Service_Config::remove (const ACE_ANTI_TCHAR svc_name[])
00192 {
00193   return ACE_Service_Config::remove (ACE_TEXT_ANTI_TO_TCHAR (svc_name));
00194 }
00195 #endif /* ACE_HAS_WINCE && !ACE_USES_WCHAR */
00196 
00197 ACE_END_VERSIONED_NAMESPACE_DECL

Generated on Sun Jan 27 12:05:37 2008 for ACE by doxygen 1.3.6