PreviousNext

Binding to Named Objects By Name

To bind to a named object by its CDS name, the argument provided to the bind( ) operation should be an unsigned_char_t pointer that specifies the name of the registered object in the CDS hierarchy. For example, the following code fragment uses a CDS name to create a local object proxy in the client application bound to a remote object:

Matrix m;

cout << "Binding to objects by name stored in CDS:" << endl;
m = Matrix::bind((unsigned_char_t *) "/.:/objects/identityMatrix");
if (m) {
print (m);
} else {
cerr << Cant bind to named object << endl;
}

In order for this to work, a server must have registered the object in CDS by calling the register_named_object( ) function.