#include <rwsf/core/NamingContext.h>
A rwsf::NamingContext object contains all rwsf::NamedObjects relevant to a particular service. On startup, the Agent creates all registered named objects and then stores them together in an instance of rwsf::NamingContext specific to each service. This context object acts like a global registry and instantiates each object.
typedef NamedObjectImp* (*RWNamingCreateMethod)();
NamingContext* getGlobalInstance();
Returns the global instance of the naming context. If a naming context does not exist, creates a new NamingContext.
NamingContext();
Default constructor.
~NamingContext();
Destructor.
void bind(const std::string& name, const rwsf::NamedObject& obj);
Adds name to the named context. If name already exists, throws an rwsf::NamingException.
rwsf::NamedObject lookup(const std::string& name) const;
Returns the rwsf::NamedObject associated with name.
void unbind(const std::string& name);
Removes this named object from the context.
rwsf::Enumeration<std::string> listBindings() const;
Returns an enumeration of the names in this context.
void load(const std::string& filename, const std::string& librarySuffix =
std::string(LEIF_DEFAULT_LIBSUFFIX));
Loads this context so it will be instantiated when the Agent is started.
static void loadGlobal(const std::string& filename, const std::string& librarySuffix =
std::string(LEIF_DEFAULT_LIBSUFFIX));
Static convenience method to reads in an object.xml file and register the named objects with the global naming context.
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks and HydraSDO is a trademark of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.