11 #include "FederatorC.h" 22 #if !defined (__ACE_INLINE__) 43 enum Action { COPY, FILENAME, IDVALUE, IORVALUE };
123 std::string toprint(endpoint, len);
126 for (
size_t i = 0; i < len; i++)
128 hash = 31 * hash + endpoint[i];
133 #if defined (ACE_USES_WCHAR) 137 hash_endpoint(hash, reinterpret_cast<const char*>(endpoint), len * 2);
146 while (curr < endpoints_str + len) {
149 next = endpoints_str + len;
159 for (
int i = 0; i < argc - 1; ++i) {
179 namespace Federator {
182 Config::FEDERATOR_CONFIG_OPTION(
ACE_TEXT(
"-FederatorConfig"));
185 Config::FEDERATOR_ID_OPTION(
ACE_TEXT(
"-FederationId"));
188 Config::FEDERATE_WITH_OPTION(
ACE_TEXT(
"-FederateWith"));
198 ACE_TEXT(
"(%P|%t) INFO: Federator::Config::Config()\n")));
205 ArgCopier argCopier(
this);
206 std::for_each(&argv[0], &argv[ argc], argCopier);
216 ACE_TEXT(
"(%P|%t) INFO: Federator::Config::~FederatorConfig()\n")));
220 delete [] this->
argv_;
228 ACE_TEXT(
"(%P|%t) INFO: Federator::Config::process()\n")));
239 if (0 != heap.
open()) {
241 ACE_TEXT(
"(%P|%t) ERROR: Federator::Config::process - ")
242 ACE_TEXT(
"unable to open configuration heap.\n")));
249 if (0 !=
import.import_config(this->
configFile_.c_str())) {
251 ACE_TEXT(
"(%P|%t) ERROR: Federator::Config::process - ")
252 ACE_TEXT(
"unable to import configuration file.\n")));
271 ACE_TEXT(
"(%P|%t) ERROR: Federator::Config::process - ")
272 ACE_TEXT(
"Unable to obtain value for FederationDomain in root section\n")));
281 ACE_TEXT(
"(%P|%t) FederationDomain == %d\n"),
290 ACE_TEXT(
"(%P|%t) ERROR: Federator::Config::process - ")
291 ACE_TEXT(
"Unable to obtain value for FederationId in root section\n")));
301 ACE_TEXT(
"(%P|%t) FederationId == %d from file ")
302 ACE_TEXT(
"overridden by value %d from command line.\n"),
311 ACE_TEXT(
"(%P|%t) FederationId == %d\n"),
321 ACE_TEXT(
"(%P|%t) ERROR: Federator::Config::process - ")
322 ACE_TEXT(
"Unable to obtain value for FederationPort in root section\n")));
331 ACE_TEXT(
"(%P|%t) FederationPort == %d\n"),
OpenDDS::Federator::Config * config_
The configuration object.
const char * c_str(void) const
int hash(const std::vector< const DDS::OctetSeq *> &src, DDS::OctetSeq &dst)
virtual int get_string_value(const ACE_Configuration_Section_Key &key, const ACE_TCHAR *name, ACE_TString &value)
int strncasecmp(const char *s, const char *t, size_t len)
Action
Identify the action to take on the next argument.
virtual const ACE_Configuration_Section_Key & root_section(void) const
void operator()(ACE_TCHAR *arg)
The Functor function operator.
void configFile(const tstring &file)
Configuration filename.
Action action_
How to treat the next argument.
size_t strlen(const char *s)
void processFile()
Process a configuration file.
const FederationDomain DEFAULT_FEDERATIONDOMAIN
const ACE_TCHAR FEDERATION_PORT_KEY[]
const ACE_TCHAR FEDERATION_ID_KEY[]
void addArg(ACE_TCHAR *arg)
Add an argument.
void hash_endpoints(::CORBA::Long &hash, const ACE_TCHAR *const endpoints_str)
static const tstring FEDERATOR_ID_OPTION
Command line option specifying the federation Id value.
TAO_DDS_DCPSFederationId & federationId()
Federation Id value.
tstring configFile_
Configuration filename, if any.
TAO_DDS_DCPSFederationId federationId_
Configured Federation Id value.
std::basic_string< ACE_TCHAR > tstring
static const tstring FEDERATOR_CONFIG_OPTION
Command line option specifying the configuration file.
void federateIor(const tstring &ior)
Initial federation IOR value.
long federationDomain_
Configured Federation Domain value.
unsigned long long ACE_UINT64
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
ACE_TCHAR ** argv_
Enhanced argv.
const char * strstr(const char *s, const char *t)
unsigned long msec(void) const
int strcasecmp(const char *s, const char *t)
Define an argument copying functor.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
ACE_Time_Value gettimeofday(void)
const ACE_TCHAR FEDERATION_DOMAIN_KEY[]
int open(const ACE_TCHAR *file_name, void *base_address=ACE_DEFAULT_BASE_ADDR, size_t default_map_size=ACE_DEFAULT_CONFIG_SECTION_SIZE)
static const tstring FEDERATE_WITH_OPTION
Command line option specifying a repository to federate with.
short federationPort_
Configured Federation Port value.
The Internal API and Implementation of OpenDDS.
void hash_endpoint(::CORBA::Long &hash, const char *const endpoint, const size_t len)