OpenRTM-aist  1.2.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RTC::CorbaNaming Class Reference

CORBA Naming Service helper class. More...

#include <CorbaNaming.h>

Public Types

typedef CORBA::SystemException SystemException
 
typedef CosNaming::NamingContext::NotFound NotFound
 
typedef CosNaming::NamingContext::CannotProceed CannotProceed
 
typedef CosNaming::NamingContext::InvalidName InvalidName
 
typedef CosNaming::NamingContext::AlreadyBound AlreadyBound
 
typedef CosNaming::NamingContext::NotEmpty NotEmpty
 
typedef CosNaming::NamingContextExt::InvalidAddress InvalidAddress
 
typedef std::vector< CORBA::Object_ptr > ObjectList
 

Public Member Functions

 CorbaNaming (CORBA::ORB_ptr orb)
 Consructor. More...
 
 CorbaNaming (CORBA::ORB_ptr orb, const char *name_server)
 Consructor. More...
 
virtual ~CorbaNaming (void)
 Virtual destructor. More...
 
void init (const char *name_server)
 Initialize the Naming Service. More...
 
bool isAlive ()
 
void bind (const CosNaming::Name &name, CORBA::Object_ptr obj, const bool force=1) throw (SystemException, NotFound, CannotProceed, InvalidName, AlreadyBound)
 Bind object on specified name component position. More...
 
void bindByString (const char *string_name, CORBA::Object_ptr obj, const bool force=1) throw (SystemException, NotFound, CannotProceed, InvalidName, AlreadyBound)
 Bind object on specified string name position. More...
 
void bindRecursive (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CORBA::Object_ptr obj) throw (SystemException, CannotProceed, InvalidName, AlreadyBound)
 Bind intermediate context recursively and bind object. More...
 
void rebind (const CosNaming::Name &name, CORBA::Object_ptr obj, const bool force=1) throw (SystemException, NotFound, CannotProceed, InvalidName)
 Rebind object. More...
 
void rebindByString (const char *string_name, CORBA::Object_ptr obj, const bool force=1) throw (SystemException, NotFound, CannotProceed, InvalidName)
 Rebind Object. More...
 
void rebindRecursive (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CORBA::Object_ptr obj) throw (SystemException, CannotProceed, InvalidName)
 Bind intermediate context recursively and rebind object. More...
 
void bindContext (const CosNaming::Name &name, CosNaming::NamingContext_ptr name_cxt, const bool force=1) throw (SystemException, NotFound, CannotProceed, InvalidName, AlreadyBound)
 Bind NamingContext. More...
 
void bindContext (const char *string_name, CosNaming::NamingContext_ptr name_cxt, const bool force=1) throw (SystemException, NotFound, CannotProceed, InvalidName, AlreadyBound)
 Bind NamingContext. More...
 
void bindContextRecursive (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CosNaming::NamingContext_ptr name_cxt)
 Bind intermediate context recursively and bind NamingContext. More...
 
void rebindContext (const CosNaming::Name &name, CosNaming::NamingContext_ptr name_cxt, const bool force=1) throw (SystemException, NotFound, CannotProceed, InvalidName)
 Rebind NamingContext. More...
 
void rebindContext (const char *string_name, CosNaming::NamingContext_ptr name_cxt, const bool force=1) throw (SystemException, NotFound, CannotProceed, InvalidName)
 Rebind NamingContext. More...
 
void rebindContextRecursive (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CosNaming::NamingContext_ptr name_cxt)
 Rebind intermediate context recursively and rebind NamingContext. More...
 
CORBA::Object_ptr resolve (const CosNaming::Name &name) throw (SystemException, NotFound, CannotProceed, InvalidName)
 Return object bound on the specified NameComponent. More...
 
CORBA::Object_ptr resolve (const char *string_name) throw (SystemException, NotFound, CannotProceed, InvalidName)
 Return object bound on the specified name. More...
 
void unbind (const CosNaming::Name &name) throw (SystemException, NotFound, CannotProceed, InvalidName)
 Unbind a binding specified by NameComponent. More...
 
void unbind (const char *string_name) throw (SystemException, NotFound, CannotProceed, InvalidName)
 Unbind a binding specified by string representation. More...
 
CosNaming::NamingContext_ptr newContext ()
 Create new NamingContext. More...
 
CosNaming::NamingContext_ptr bindNewContext (const CosNaming::Name &name, bool force=true) throw (SystemException, NotFound, CannotProceed, InvalidName, AlreadyBound)
 Bind new NamingContext. More...
 
CosNaming::NamingContext_ptr bindNewContext (const char *string_name, bool force=true) throw (SystemException, NotFound, CannotProceed, InvalidName, AlreadyBound)
 Bind new NamingContext. More...
 
void destroy (CosNaming::NamingContext_ptr context) throw (SystemException, NotEmpty)
 Destroy the naming context. More...
 
void destroyRecursive (CosNaming::NamingContext_ptr context) throw (SystemException, NotEmpty, NotFound, CannotProceed, InvalidName)
 Destroy the naming context recursively. More...
 
void clearAll ()
 Destroy all bindings. More...
 
void list (CosNaming::NamingContext_ptr name_cxt, CORBA::ULong how_many, CosNaming::BindingList_var &bl, CosNaming::BindingIterator_var &bi)
 Get Binding of the given NamingContext. More...
 
void list (const char *string_name, CosNaming::BindingList_var &bl)
 Get all the binding under given naming path. More...
 
void listByKind (const char *string_name, const char *string_kind, CosNaming::BindingList_var &bl)
 Get all the binding with specified kind under given naming path. More...
 
char * toString (const CosNaming::Name &name) throw (SystemException, InvalidName)
 Get string representation of given NameComponent. More...
 
CosNaming::Name toName (const char *string_name) throw (SystemException, InvalidName)
 Resolve given string representation to NameComponent. More...
 
char * toUrl (char *addr, char *string_name) throw (SystemException, InvalidAddress, InvalidName)
 Get URL representation from given addr and string_name. More...
 
CORBA::Object_ptr resolveStr (const char *string_name) throw (SystemException, NotFound, CannotProceed, InvalidName, AlreadyBound)
 Resolve from name of string representation and get object. More...
 
CORBA::Object_ptr bindOrResolve (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CORBA::Object_ptr obj)
 Bind or resolve the given name component. More...
 
CosNaming::NamingContext_ptr bindOrResolveContext (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CosNaming::NamingContext_ptr new_context)
 Bind or resolve the given name component. More...
 
CosNaming::NamingContext_ptr bindOrResolveContext (CosNaming::NamingContext_ptr context, const CosNaming::Name &name)
 Bind or resolve the given name component. More...
 
const char * getNameServer ()
 Get the name of name server. More...
 
CosNaming::NamingContext_ptr getRootContext ()
 Get the root context. More...
 
bool isNamingContext (CORBA::Object_ptr obj)
 Determine whether the object is NamingContext. More...
 
bool isNamingContext (const CosNaming::Name &name)
 Determine whether the given name component is NamingContext. More...
 
bool isNamingContext (const char *string_name)
 Determine whether the given string name is NamingContext. More...
 
CosNaming::Name subName (const CosNaming::Name &name, CORBA::Long begin, CORBA::Long end=-1)
 Get subset of given name component. More...
 

Protected Member Functions

void nameToString (const CosNaming::Name &name, char *string_name, CORBA::ULong slen)
 Get string representation of name component. More...
 
CORBA::ULong getNameLength (const CosNaming::Name &name)
 Get string length of the name component's string representation. More...
 
unsigned int split (const std::string &input, const std::string &delimiter, std::vector< std::string > &results)
 Split of string. More...
 

Protected Attributes

CORBA::ORB_ptr m_ptrORB
 ORB. More...
 
std::string m_nameServer
 Name of the name server. More...
 
CosNaming::NamingContextExt_var m_rootContext
 The root context of specified name server. More...
 

Detailed Description

CORBA Naming Service helper class.

This class is a wrapper class of CosNaming::NamingContext. Almost the same operations which CosNaming::NamingContext has are provided, and some operation allows string naming representation of context and object instead of CosNaming::Name.

The object of the class would connect to a CORBA naming server at the instantiation or immediately after instantiation. After that the object invokes operations to the root context of it. This class realizes forced binding to deep NamingContext, without binding intermediate NamingContexts explicitly.

Since
0.4.0

Member Typedef Documentation

typedef CosNaming::NamingContext::AlreadyBound RTC::CorbaNaming::AlreadyBound
typedef CosNaming::NamingContext::CannotProceed RTC::CorbaNaming::CannotProceed
typedef CosNaming::NamingContextExt::InvalidAddress RTC::CorbaNaming::InvalidAddress
typedef CosNaming::NamingContext::InvalidName RTC::CorbaNaming::InvalidName
typedef CosNaming::NamingContext::NotEmpty RTC::CorbaNaming::NotEmpty
typedef CosNaming::NamingContext::NotFound RTC::CorbaNaming::NotFound
typedef std::vector<CORBA::Object_ptr> RTC::CorbaNaming::ObjectList
typedef CORBA::SystemException RTC::CorbaNaming::SystemException

Constructor & Destructor Documentation

RTC::CorbaNaming::CorbaNaming ( CORBA::ORB_ptr  orb)

Consructor.

Parameters
orbORB
RTC::CorbaNaming::CorbaNaming ( CORBA::ORB_ptr  orb,
const char *  name_server 
)

Consructor.

Parameters
orbORB
name_serverName of the name server
virtual RTC::CorbaNaming::~CorbaNaming ( void  )
inlinevirtual

Virtual destructor.

References init(), and isAlive().

Member Function Documentation

void RTC::CorbaNaming::bind ( const CosNaming::Name &  name,
CORBA::Object_ptr  obj,
const bool  force = 1 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName,
AlreadyBound
)

Bind object on specified name component position.

Almost the same operation as CosNaming::bind(), but there is a difference that bind() is invoked for the root context of the given name server.

Bind between Name <name> and Object <obj> on this NamingContext. If c_n indicates the n-th of NameComponent, when name consists of n pieces of NameComponent, it is handled as follows.

cxt->bind(<c_1, c_2, ... c_n>, obj) is the same as the following operation. cxt->resolve(<c_1, ... c_(n-1)>)->bind(<c_n>, obj)

In other word, resolve from the first to the (n-1)th context and bind obj as name<n> on the (n-1)th context. NemingContext of <c_1, ... c_(n-1)> for resolving name must be already bound in bindContext() or rebindContext(). If NamingContext of <c_1, ... c_(n-1)> does not exist, NotFound excption will occur.

However, when flag of forced bind is true, even if <c_1, ... c_(n-1)> does not exist, finally obj will be bound to name name <c_n> by binding to the context recursively.

Even in any case, if the object of name<n> (Object or context) is bound on the (n-1)th context, AlreadyBound exception will occur.

Parameters
nameNameComponent of name applied to object
objObject that is associated
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
AlreadyBoundThe object of name<c_n> is already bound.
void RTC::CorbaNaming::bindByString ( const char *  string_name,
CORBA::Object_ptr  obj,
const bool  force = 1 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName,
AlreadyBound
)

Bind object on specified string name position.

This is the same as bind() except as the given name is string representation when Object is bound. bind(toName(string_name),obj) is the same.

Parameters
string_nameThe string representation of name applied to object
objObject that is associated
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
AlreadyBoundThe object of name<c_n> is already bound.
void RTC::CorbaNaming::bindContext ( const CosNaming::Name &  name,
CosNaming::NamingContext_ptr  name_cxt,
const bool  force = 1 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName,
AlreadyBound
)

Bind NamingContext.

This is the same as bind() except as the bound object is NamingContext.

Parameters
nameNameComponent of name applied to object
name_cxtObject that is associated
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
AlreadyBoundThe object of name<c_n> is already bound.
void RTC::CorbaNaming::bindContext ( const char *  string_name,
CosNaming::NamingContext_ptr  name_cxt,
const bool  force = 1 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName,
AlreadyBound
)

Bind NamingContext.

This is the same as bindByString() except as the bound object is NamingContext.

Parameters
string_nameString representation of name applied to object
name_cxtNamingContext that is associated
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
AlreadyBoundThe object of name<n> is already bound.
void RTC::CorbaNaming::bindContextRecursive ( CosNaming::NamingContext_ptr  context,
const CosNaming::Name &  name,
CosNaming::NamingContext_ptr  name_cxt 
)

Bind intermediate context recursively and bind NamingContext.

This is the same as bindRecursive() except as the bound object is NamingContext.

Parameters
contextNamingContext that starts the bind
nameNameComponent of name applied to object
name_cxtNamingContext that is associated
CosNaming::NamingContext_ptr RTC::CorbaNaming::bindNewContext ( const CosNaming::Name &  name,
bool  force = true 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName,
AlreadyBound
)

Bind new NamingContext.

Bind new context for the given name. The created NamingContext is a creation on the name server.

Parameters
nameNameComponent applied to NamingContext
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Returns
New created NamingContext
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
AlreadyBoundThe object of name<n> is already bound.
CosNaming::NamingContext_ptr RTC::CorbaNaming::bindNewContext ( const char *  string_name,
bool  force = true 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName,
AlreadyBound
)

Bind new NamingContext.

Bind new context corresponding to the given string. The created NamingContext is a creation on the name server.

Parameters
string_nameThe string representation of name applied to NamingContext
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Returns
New created NamingContext
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
AlreadyBoundThe object of name<n> is already bound.
CORBA::Object_ptr RTC::CorbaNaming::bindOrResolve ( CosNaming::NamingContext_ptr  context,
const CosNaming::Name &  name,
CORBA::Object_ptr  obj 
)

Bind or resolve the given name component.

Bind object at the position that specified in NameComponent for the specified context. When other elements are already bound at the same position, get the already bound element.

Parameters
contextThe context to bind or resole
nameNameComponent applied to object
objObject that is associated
Returns
The object that is bound at position specified with NameComponent
CosNaming::NamingContext_ptr RTC::CorbaNaming::bindOrResolveContext ( CosNaming::NamingContext_ptr  context,
const CosNaming::Name &  name,
CosNaming::NamingContext_ptr  new_context 
)

Bind or resolve the given name component.

Bind Context at the position that specified in NameComponent for the specified context. When other elements are already bound at the same position, get the already bound element.

Parameters
contextThe context to bind or resole
nameNameComponent applied to object
new_contextContext that is associated
Returns
The Context that is bound at the position specified with NameComponent
CosNaming::NamingContext_ptr RTC::CorbaNaming::bindOrResolveContext ( CosNaming::NamingContext_ptr  context,
const CosNaming::Name &  name 
)

Bind or resolve the given name component.

Bind new Context at the position that specified in NameComponent for the specified context. When other elements are already bound at the same position, get the already bound element.

Parameters
contextThe context to bind or resole
nameNameComponent that indicates the position of new context
Returns
The Context that is bound at the position specified with NameComponent
void RTC::CorbaNaming::bindRecursive ( CosNaming::NamingContext_ptr  context,
const CosNaming::Name &  name,
CORBA::Object_ptr  obj 
)
throw (SystemException,
CannotProceed,
InvalidName,
AlreadyBound
)

Bind intermediate context recursively and bind object.

For NamingContext given in context, bind obj to name <c_n> with solving name component <c_1, ... c_(n-1)> specified by name as NamingContext. Bind new NamingContext when there is no NamingContext corresponding to c_(n-1) >.

Finally, NamingContext corresponding to <c_1, c_2, ..., c_(n-1)> will be generated, or CosNaming::bind(<c_n>, object) will be invoked after solving. At this time, if the binding already exists, the AlreadyBound exception will occur.

During process, when Binding that is not NamingContext of the same name as the context for solving exists, CannotProceed exception will occur and stop processing.

Parameters
contextNamingContext that starts the bind
nameNameComponent of name applied to object
objObject that is associated
Exceptions
CannotProceedSince one of NamingContext corresponding to <c_1, ..., c_(n-1)> is already bound to object other than NamingContext and processing cannot be continued
InvalidNamename 'name' is invalid.
AlreadyBoundThe object of name<c_n> is already bound.
void RTC::CorbaNaming::clearAll ( )

Destroy all bindings.

Destroy all bindings that are registered.

void RTC::CorbaNaming::destroy ( CosNaming::NamingContext_ptr  context)
throw (SystemException,
NotEmpty
)

Destroy the naming context.

Destroy the specified naming context. Any bindings should be <unbind> in which the given context is bound to some names before invoking <destroy> operation on it.

Parameters
contextNamingContext which is destroied.
Exceptions
NotEmptyThe target context is bound to the other context.
void RTC::CorbaNaming::destroyRecursive ( CosNaming::NamingContext_ptr  context)
throw (SystemException,
NotEmpty,
NotFound,
CannotProceed,
InvalidName
)

Destroy the naming context recursively.

For NamingContext given by Context, Destroy name <c_n> with solving the name component specified by name as NamingContext recursively.

Parameters
contextNamingContext which is Destroied.
Exceptions
NotEmptyThe target context is bound to the other context.
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
CORBA::ULong RTC::CorbaNaming::getNameLength ( const CosNaming::Name &  name)
protected

Get string length of the name component's string representation.

Get string length of the name component's string representation. In string representation, if NameComponent consists of {Nc[0],Nc[1],Nc[2]・・・}, the format of Nc[0]id.Nc[0].kind/Nc[1]id.Nc[1].kind/Nc[2].id/Nc[2].kind・・・ will be got.

Parameters
nameThe getting target NameComponent
Returns
The string length value of specified component
const char* RTC::CorbaNaming::getNameServer ( )

Get the name of name server.

Get the configured name of name server

Returns
The name of name server
CosNaming::NamingContext_ptr RTC::CorbaNaming::getRootContext ( )

Get the root context.

Get the root context of the configured name server

Returns
Root context ot name server
void RTC::CorbaNaming::init ( const char *  name_server)

Initialize the Naming Service.

Initialize the Naming Service on the specified name server.

Parameters
name_serverName of the name server

Referenced by ~CorbaNaming().

bool RTC::CorbaNaming::isAlive ( )

Referenced by ~CorbaNaming().

bool RTC::CorbaNaming::isNamingContext ( CORBA::Object_ptr  obj)

Determine whether the object is NamingContext.

Determine whether the specified element is NamingContext

Parameters
objThe target element for determination
Returns
Determination result (NamingContext:true, Else:false)
bool RTC::CorbaNaming::isNamingContext ( const CosNaming::Name &  name)

Determine whether the given name component is NamingContext.

Determine whether the specified element is NameComponent

Parameters
nameThe target NameComponent for determination
Returns
Determination result (NamingContext:true, Else:false)
bool RTC::CorbaNaming::isNamingContext ( const char *  string_name)

Determine whether the given string name is NamingContext.

Determine whether the element specified by string name is NamingContext

Parameters
string_nameThe string representation for determination
Returns
Determination result (NamingContext:true, Else:false)
void RTC::CorbaNaming::list ( CosNaming::NamingContext_ptr  name_cxt,
CORBA::ULong  how_many,
CosNaming::BindingList_var &  bl,
CosNaming::BindingIterator_var &  bi 
)

Get Binding of the given NamingContext.

Get Binding of the given NamingContext.

Parameters
name_cxtNamingContext of the getting target Binding
how_manyThe depth to get Binding
blThe holder to hold the got Binding
biThe iterator to detect the got Binding
void RTC::CorbaNaming::list ( const char *  string_name,
CosNaming::BindingList_var &  bl 
)

Get all the binding under given naming path.

This operation obtains all the binding list, which are a pair of binding type and reference, under specified absolute naming path. The path string consists of the path from root context delimited by "/" and name and context delimited by ".".

For example, when <name0>.<context0>/.../<name[n]>.<context[n]> is specified as the path, this operation returns all the contexts and references under the "<name[n]>.<context[n]>" context in a BindingList.

Parameters
string_name[in] The target path specified by a string
bl[out] Binding list under the specified path
void RTC::CorbaNaming::listByKind ( const char *  string_name,
const char *  string_kind,
CosNaming::BindingList_var &  bl 
)

Get all the binding with specified kind under given naming path.

This operation obtains all the binding list with specified kind under specified absolute naming path. The path string consists of the path from root context delimited by "/" and name and context delimited by ".".

For example, when <name0>.<context0>/.../<name[n]>.<context[n]> is specified in the first argument as the path, and "hoge" is specified the second argument as the kind, this operation returns all the contexts and references under the "<name[n]>.<context[n]>" context with kind "hoge" in a BindingList.

Parameters
string_name[in] The target path specified by a string
string_kind[in] The target kind specified by a string
bl[out] Binding list under the specified path
void RTC::CorbaNaming::nameToString ( const CosNaming::Name &  name,
char *  string_name,
CORBA::ULong  slen 
)
protected

Get string representation of name component.

Get string representation of the name component in specified range. In string representation, if NameComponent consists of {Nc[0],Nc[1],Nc[2]...}, the format of Nc[0]id.Nc[0].kind/Nc[1]id.Nc[1].kind/Nc[2].id/Nc[2].kind... will be got. It is rounded by the specified length when the length of the got string is over the specified length.

Parameters
nameThe getting target NameComponent
string_nameThe string of getting result
slenThe maximum length value of getting string
CosNaming::NamingContext_ptr RTC::CorbaNaming::newContext ( )

Create new NamingContext.

Return NamingContext that has been created on the given name server. The returned NamingContext has not bound yet.

Returns
New created NamingContext
void RTC::CorbaNaming::rebind ( const CosNaming::Name &  name,
CORBA::Object_ptr  obj,
const bool  force = 1 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName
)

Rebind object.

This is the same as bind() except as Binding specified by name already exists. If the binding already exists, new binding will be replaced.

Parameters
nameNameComponent of name applied to object
objObject that is associated
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameName 'name' is invalid.
void RTC::CorbaNaming::rebindByString ( const char *  string_name,
CORBA::Object_ptr  obj,
const bool  force = 1 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName
)

Rebind Object.

This is the same as rebind() except as the given name is string representation when object is rebound. rebind(toName(string_name), obj) is the same.

Parameters
string_nameNameComponent of name applied to object
objObject that is associated
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
void RTC::CorbaNaming::rebindContext ( const CosNaming::Name &  name,
CosNaming::NamingContext_ptr  name_cxt,
const bool  force = 1 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName
)

Rebind NamingContext.

This is the same as bindContext() except as context specified by name already exists. If the binding already exists, new binding will be replaced.

Parameters
nameNameComponent applied to object
name_cxtObject that is associated
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNamethe argument 'name' is invalid.
void RTC::CorbaNaming::rebindContext ( const char *  string_name,
CosNaming::NamingContext_ptr  name_cxt,
const bool  force = 1 
)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName
)

Rebind NamingContext.

This is the same as bindContext() except as context specified by name already exists. If the binding already exists, new binding will be replaced.

Parameters
string_nameString representation of name applied to object
name_cxtNamingContext that is associated
forceIf true, the intermediate context is bound forcibly. (The default value:true)
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
void RTC::CorbaNaming::rebindContextRecursive ( CosNaming::NamingContext_ptr  context,
const CosNaming::Name &  name,
CosNaming::NamingContext_ptr  name_cxt 
)

Rebind intermediate context recursively and rebind NamingContext.

This is the same as rebindRecursive() except as the bound object is NamingContext.

Parameters
contextNamingContext that starts the bind
nameNameComponent applied to object
name_cxtNamingContext that is associated
void RTC::CorbaNaming::rebindRecursive ( CosNaming::NamingContext_ptr  context,
const CosNaming::Name &  name,
CORBA::Object_ptr  obj 
)
throw (SystemException,
CannotProceed,
InvalidName
)

Bind intermediate context recursively and rebind object.

This is the same as bindRecursive() except as NamingContext or Object specified by name <c_n> already exists.

If the binding specified by name <c_n> already exists, new binding will be replaced.

Parameters
contextNamingContext that starts the bind
nameNameComponent of name applied to object
objObject that is associated
Exceptions
CannotProceedThe intermediate context cannot resolved.
InvalidNameThe given name is invalid.
CORBA::Object_ptr RTC::CorbaNaming::resolve ( const CosNaming::Name &  name)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName
)

Return object bound on the specified NameComponent.

Return the object reference that is bound to name. Resolve the name component<c_1, c_2, ... c_n> recursively.

Almost the same operation as CosNaming::resolve(), but there is a difference that resolve() is invoked for the root context of the given name server.

Parameters
nameThe name component of object name that should be resolved
Returns
The reference to the resolved object
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
CORBA::Object_ptr RTC::CorbaNaming::resolve ( const char *  string_name)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName
)

Return object bound on the specified name.

Return the object reference that is bound to name. Resolve the name component<c_1, c_2, ... c_n> recursively.

Almost the same operation as CosNaming::resolve(), but there is a difference that resolve() is invoked for the root context of the given name server.

Parameters
string_nameThe string representation of object name that should be resolved
Returns
The reference to the resolved object
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
CORBA::Object_ptr RTC::CorbaNaming::resolveStr ( const char *  string_name)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName,
AlreadyBound
)

Resolve from name of string representation and get object.

Resolve specified string representation and get object

Parameters
string_nameThe string representation of getting target object
Returns
The resolved object
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
AlreadyBoundThe object of name<n> is already bound.
unsigned int RTC::CorbaNaming::split ( const std::string &  input,
const std::string &  delimiter,
std::vector< std::string > &  results 
)
protected

Split of string.

Split string with specified delimiter.

Parameters
inputThe split target string
delimiterThe delimiter for split
resultsSplit result
Returns
The number of split string elements
CosNaming::Name RTC::CorbaNaming::subName ( const CosNaming::Name &  name,
CORBA::Long  begin,
CORBA::Long  end = -1 
)

Get subset of given name component.

Get the name component in specified range. Return the name component except the last element if the end position is not specified.

Parameters
nameThe target NameComponent for search
beginThe beginning position for getting range
endThe end position for getting range (The default value:-1)
Returns
NameComponent Getting result
CosNaming::Name RTC::CorbaNaming::toName ( const char *  string_name)
throw (SystemException,
InvalidName
)

Resolve given string representation to NameComponent.

Transform given string representation to NameComponent.

Parameters
string_nameThe target string representation to transform
Returns
NameComponent The result of transformation
Exceptions
InvalidNameThe argument 'name' is invalid.
char* RTC::CorbaNaming::toString ( const CosNaming::Name &  name)
throw (SystemException,
InvalidName
)

Get string representation of given NameComponent.

Transform specified NameComponent into string representation.

Parameters
nameThe target NameComponent for transformation
Returns
Trnasformation result of string representation
Exceptions
InvalidNameThe argument 'name' is invalid.
char* RTC::CorbaNaming::toUrl ( char *  addr,
char *  string_name 
)
throw (SystemException,
InvalidAddress,
InvalidName
)

Get URL representation from given addr and string_name.

Convert specified addr and string_name into URL

Parameters
addrThe target address for conversion
string_nameThe target name for conversion
Returns
URL Conversion result
Exceptions
InvalidAddressThe argument 'addr' is invalid.
InvalidNameThe argument 'string_name' is invalid.
void RTC::CorbaNaming::unbind ( const CosNaming::Name &  name)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName
)

Unbind a binding specified by NameComponent.

Return the object reference that is bound to name. Resolve the name component<c_1, c_2, ... c_n> recursively.

Almost the same operation as CosNaming::unbind(), but there is a difference that unbind() is invoked for the root context of the always given name server.

Parameters
nameThe name component of the deleted object
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.
void RTC::CorbaNaming::unbind ( const char *  string_name)
throw (SystemException,
NotFound,
CannotProceed,
InvalidName
)

Unbind a binding specified by string representation.

Return the object reference that is bound to name. Resolve the name component<c_1, c_2, ... c_n> recursively.

Almost the same operation as CosNaming::unbind(), but there is a difference that unbind() is invoked for the root context of the always given name server.

Parameters
string_nameThe string representation of object name that should be resolved
Returns
The resolved object reference
Exceptions
NotFoundThere is not <c_1, c_2, ..., c_(n-1)>.
CannotProceedProcessing cannot be continued for some reasons.
InvalidNameThe argument 'name' is invalid.

Member Data Documentation

std::string RTC::CorbaNaming::m_nameServer
protected

Name of the name server.

CORBA::ORB_ptr RTC::CorbaNaming::m_ptrORB
protected

ORB.

CosNaming::NamingContextExt_var RTC::CorbaNaming::m_rootContext
protected

The root context of specified name server.


The documentation for this class was generated from the following file: