OpenRTM-aist 2.0.2
Loading...
Searching...
No Matches
RTC::CorbaNaming Class Reference

CORBA Naming Service helper class. More...

#include <CorbaNaming.h>

Public Types

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

Public Member Functions

 CorbaNaming (CORBA::ORB_ptr orb)
 Consructor.
 
 CorbaNaming (CORBA::ORB_ptr orb, const char *name_server)
 Consructor.
 
virtual ~CorbaNaming ()
 Virtual destructor.
 
void init (const char *name_server)
 Initialize the Naming Service.
 
bool isAlive ()
 
void bind (const CosNaming::Name &name, CORBA::Object_ptr obj, bool force=true)
 Bind object on specified name component position.
 
void bindByString (const char *string_name, CORBA::Object_ptr obj, bool force=true)
 Bind object on specified string name position.
 
void bindRecursive (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CORBA::Object_ptr obj)
 Bind intermediate context recursively and bind object.
 
void rebind (const CosNaming::Name &name, CORBA::Object_ptr obj, bool force=true)
 Rebind object.
 
void rebindByString (const char *string_name, CORBA::Object_ptr obj, bool force=true)
 Rebind Object.
 
void bindContext (const CosNaming::Name &name, CosNaming::NamingContext_ptr name_cxt, bool force=true)
 Bind NamingContext.
 
void bindContext (const char *string_name, CosNaming::NamingContext_ptr name_cxt, bool force=true)
 Bind NamingContext.
 
void bindContextRecursive (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CosNaming::NamingContext_ptr name_cxt)
 Bind intermediate context recursively and bind NamingContext.
 
void rebindContext (const CosNaming::Name &name, CosNaming::NamingContext_ptr name_cxt, bool force=true)
 Rebind NamingContext.
 
void rebindContext (const char *string_name, CosNaming::NamingContext_ptr name_cxt, bool force=true)
 Rebind NamingContext.
 
CORBA::Object_ptr resolve (const CosNaming::Name &name)
 Return object bound on the specified NameComponent.
 
CORBA::Object_ptr resolve (const char *string_name)
 Return object bound on the specified name.
 
void unbind (const CosNaming::Name &name)
 Unbind a binding specified by NameComponent.
 
void unbind (const char *string_name)
 Unbind a binding specified by string representation.
 
CosNaming::NamingContext_ptr newContext ()
 Create new NamingContext.
 
CosNaming::NamingContext_ptr bindNewContext (const CosNaming::Name &name, bool force=true)
 Bind new NamingContext.
 
CosNaming::NamingContext_ptr bindNewContext (const char *string_name, bool force=true)
 Bind new NamingContext.
 
void destroyRecursive (CosNaming::NamingContext_ptr context)
 Destroy the naming context recursively.
 
void clearAll ()
 Destroy all bindings.
 
void list (const char *string_name, CosNaming::BindingList_var &bl)
 Get all the binding under given naming path.
 
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.
 
char * toUrl (char *addr, char *string_name)
 Get URL representation from given addr and string_name.
 
CORBA::Object_ptr resolveStr (const char *string_name)
 Resolve from name of string representation and get object.
 
CosNaming::NamingContext_ptr bindOrResolveContext (CosNaming::NamingContext_ptr context, const CosNaming::Name &name)
 Bind or resolve the given name component.
 
const char * getNameServer ()
 Get the name of name server.
 
CosNaming::NamingContext_ptr getRootContext ()
 Get the root context.
 
bool isNamingContext (const CosNaming::Name &name)
 Determine whether the given name component is NamingContext.
 
bool isNamingContext (const char *string_name)
 Determine whether the given string name is NamingContext.
 

Static Public Member Functions

static void rebindRecursive (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CORBA::Object_ptr obj)
 Bind intermediate context recursively and rebind object.
 
static void rebindContextRecursive (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CosNaming::NamingContext_ptr name_cxt)
 Rebind intermediate context recursively and rebind NamingContext.
 
static void destroy (CosNaming::NamingContext_ptr context)
 Destroy the naming context.
 
static 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.
 
static char * toString (const CosNaming::Name &name)
 Get string representation of given NameComponent.
 
static CosNaming::Name toName (const char *sname)
 Resolve given string representation to NameComponent.
 
static CORBA::Object_ptr bindOrResolve (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CORBA::Object_ptr obj)
 Bind or resolve the given name component.
 
static CosNaming::NamingContext_ptr bindOrResolveContext (CosNaming::NamingContext_ptr context, const CosNaming::Name &name, CosNaming::NamingContext_ptr new_context)
 Bind or resolve the given name component.
 
static bool isNamingContext (CORBA::Object_ptr obj)
 Determine whether the object is NamingContext.
 
static CosNaming::Name subName (const CosNaming::Name &name, CORBA::Long begin, CORBA::Long end=-1)
 Get subset of given name component.
 

Static Protected Member Functions

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

Protected Attributes

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

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

◆ AlreadyBound

using RTC::CorbaNaming::AlreadyBound = CosNaming::NamingContext::AlreadyBound

◆ CannotProceed

using RTC::CorbaNaming::CannotProceed = CosNaming::NamingContext::CannotProceed

◆ InvalidAddress

using RTC::CorbaNaming::InvalidAddress = CosNaming::NamingContextExt::InvalidAddress

◆ InvalidName

using RTC::CorbaNaming::InvalidName = CosNaming::NamingContext::InvalidName

◆ NotEmpty

using RTC::CorbaNaming::NotEmpty = CosNaming::NamingContext::NotEmpty

◆ NotFound

using RTC::CorbaNaming::NotFound = CosNaming::NamingContext::NotFound

◆ ObjectList

using RTC::CorbaNaming::ObjectList = std::vector<CORBA::Object_ptr>

◆ SystemException

using RTC::CorbaNaming::SystemException = CORBA::SystemException

Constructor & Destructor Documentation

◆ CorbaNaming() [1/2]

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

Consructor.

Parameters
orbORB

◆ CorbaNaming() [2/2]

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

Consructor.

Parameters
orbORB
name_serverName of the name server

◆ ~CorbaNaming()

virtual RTC::CorbaNaming::~CorbaNaming ( )
virtual

Virtual destructor.

Member Function Documentation

◆ bind()

void RTC::CorbaNaming::bind ( const CosNaming::Name & name,
CORBA::Object_ptr obj,
bool force = true )

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.

◆ bindByString()

void RTC::CorbaNaming::bindByString ( const char * string_name,
CORBA::Object_ptr obj,
bool force = true )

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.

◆ bindContext() [1/2]

void RTC::CorbaNaming::bindContext ( const char * string_name,
CosNaming::NamingContext_ptr name_cxt,
bool force = true )

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.

◆ bindContext() [2/2]

void RTC::CorbaNaming::bindContext ( const CosNaming::Name & name,
CosNaming::NamingContext_ptr name_cxt,
bool force = true )

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.

◆ bindContextRecursive()

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

◆ bindNewContext() [1/2]

CosNaming::NamingContext_ptr RTC::CorbaNaming::bindNewContext ( const char * string_name,
bool force = true )

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.

◆ bindNewContext() [2/2]

CosNaming::NamingContext_ptr RTC::CorbaNaming::bindNewContext ( const CosNaming::Name & name,
bool force = true )

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.

◆ bindOrResolve()

static CORBA::Object_ptr RTC::CorbaNaming::bindOrResolve ( CosNaming::NamingContext_ptr context,
const CosNaming::Name & name,
CORBA::Object_ptr obj )
static

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

◆ bindOrResolveContext() [1/2]

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

◆ bindOrResolveContext() [2/2]

static CosNaming::NamingContext_ptr RTC::CorbaNaming::bindOrResolveContext ( CosNaming::NamingContext_ptr context,
const CosNaming::Name & name,
CosNaming::NamingContext_ptr new_context )
static

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

◆ bindRecursive()

void RTC::CorbaNaming::bindRecursive ( CosNaming::NamingContext_ptr context,
const CosNaming::Name & name,
CORBA::Object_ptr obj )

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.

◆ clearAll()

void RTC::CorbaNaming::clearAll ( )

Destroy all bindings.

Destroy all bindings that are registered.

◆ destroy()

static void RTC::CorbaNaming::destroy ( CosNaming::NamingContext_ptr context)
static

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.

◆ destroyRecursive()

void RTC::CorbaNaming::destroyRecursive ( CosNaming::NamingContext_ptr context)

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.

◆ getNameLength()

static CORBA::ULong RTC::CorbaNaming::getNameLength ( const CosNaming::Name & name)
staticprotected

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

◆ getNameServer()

const char * RTC::CorbaNaming::getNameServer ( )

Get the name of name server.

Get the configured name of name server

Returns
The name of name server

◆ getRootContext()

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

◆ init()

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

◆ isAlive()

bool RTC::CorbaNaming::isAlive ( )

◆ isNamingContext() [1/3]

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)

◆ isNamingContext() [2/3]

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)

◆ isNamingContext() [3/3]

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

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)

◆ list() [1/2]

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

◆ list() [2/2]

static void RTC::CorbaNaming::list ( CosNaming::NamingContext_ptr name_cxt,
CORBA::ULong how_many,
CosNaming::BindingList_var & bl,
CosNaming::BindingIterator_var & bi )
static

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

◆ listByKind()

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

◆ nameToString()

static void RTC::CorbaNaming::nameToString ( const CosNaming::Name & name,
char * string_name,
CORBA::ULong slen )
staticprotected

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

◆ newContext()

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

◆ rebind()

void RTC::CorbaNaming::rebind ( const CosNaming::Name & name,
CORBA::Object_ptr obj,
bool force = true )

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.

◆ rebindByString()

void RTC::CorbaNaming::rebindByString ( const char * string_name,
CORBA::Object_ptr obj,
bool force = true )

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.

◆ rebindContext() [1/2]

void RTC::CorbaNaming::rebindContext ( const char * string_name,
CosNaming::NamingContext_ptr name_cxt,
bool force = true )

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.

◆ rebindContext() [2/2]

void RTC::CorbaNaming::rebindContext ( const CosNaming::Name & name,
CosNaming::NamingContext_ptr name_cxt,
bool force = true )

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.

◆ rebindContextRecursive()

static void RTC::CorbaNaming::rebindContextRecursive ( CosNaming::NamingContext_ptr context,
const CosNaming::Name & name,
CosNaming::NamingContext_ptr name_cxt )
static

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

◆ rebindRecursive()

static void RTC::CorbaNaming::rebindRecursive ( CosNaming::NamingContext_ptr context,
const CosNaming::Name & name,
CORBA::Object_ptr obj )
static

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.

◆ resolve() [1/2]

CORBA::Object_ptr RTC::CorbaNaming::resolve ( const char * string_name)

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.

◆ resolve() [2/2]

CORBA::Object_ptr RTC::CorbaNaming::resolve ( const CosNaming::Name & name)

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.

◆ resolveStr()

CORBA::Object_ptr RTC::CorbaNaming::resolveStr ( const char * string_name)

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.

◆ split()

static unsigned int RTC::CorbaNaming::split ( const std::string & input,
const std::string & delimiter,
std::vector< std::string > & results )
staticprotected

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

◆ subName()

static CosNaming::Name RTC::CorbaNaming::subName ( const CosNaming::Name & name,
CORBA::Long begin,
CORBA::Long end = -1 )
static

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

◆ toName()

static CosNaming::Name RTC::CorbaNaming::toName ( const char * sname)
static

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.

◆ toString()

static char * RTC::CorbaNaming::toString ( const CosNaming::Name & name)
static

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.

◆ toUrl()

char * RTC::CorbaNaming::toUrl ( char * addr,
char * string_name )

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.

◆ unbind() [1/2]

void RTC::CorbaNaming::unbind ( const char * string_name)

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.

◆ unbind() [2/2]

void RTC::CorbaNaming::unbind ( const CosNaming::Name & name)

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.

Member Data Documentation

◆ m_nameServer

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

Name of the name server .

◆ m_ptrORB

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

ORB .

◆ m_rootContext

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: