ACE  6.2.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ACE_Naming_Context Class Reference

Maintaining accesses Name Server Databases. Allows to add NameBindings, change them, remove them and resolve NameBindings. More...

#include <Naming_Context.h>

Inheritance diagram for ACE_Naming_Context:
Inheritance graph
[legend]
Collaboration diagram for ACE_Naming_Context:
Collaboration graph
[legend]

Public Types

enum  Context_Scope_Type { PROC_LOCAL, NODE_LOCAL, NET_LOCAL }
 
- Public Types inherited from ACE_Event_Handler
enum  {
  LO_PRIORITY = 0, HI_PRIORITY = 10, NULL_MASK = 0, READ_MASK = (1 << 0),
  WRITE_MASK = (1 << 1), EXCEPT_MASK = (1 << 2), ACCEPT_MASK = (1 << 3), CONNECT_MASK = (1 << 4),
  TIMER_MASK = (1 << 5), QOS_MASK = (1 << 6), GROUP_QOS_MASK = (1 << 7), SIGNAL_MASK = (1 << 8),
  ALL_EVENTS_MASK, RWE_MASK, DONT_CALL = (1 << 9)
}
 
enum  { ACE_EVENT_HANDLER_NOT_RESUMED = -1, ACE_REACTOR_RESUMES_HANDLER = 0, ACE_APPLICATION_RESUMES_HANDLER }
 
typedef long Reference_Count
 Reference count type. More...
 

Public Member Functions

 ACE_Naming_Context (void)
 "Do-nothing" constructor. More...
 
 ACE_Naming_Context (Context_Scope_Type scope_in, int light=0)
 
int open (Context_Scope_Type scope_in=ACE_Naming_Context::PROC_LOCAL, int light=0)
 
int close (void)
 
int close_down (void)
 Release all resources. Gets called by destructor and fini. More...
 
 ~ACE_Naming_Context (void)
 
virtual int init (int argc, ACE_TCHAR *argv[])
 
virtual int fini (void)
 Close down the test when dynamically unlinked. More...
 
virtual int info (ACE_TCHAR **strp, size_t length) const
 Returns information about this context. More...
 
ACE_Name_Optionsname_options (void)
 Returns the ACE_Name_Options associated with the Naming_Context. More...
 
int bind (const ACE_NS_WString &name_in, const ACE_NS_WString &value_in, const char *type_in="")
 Bind a new name to a naming context (Wide character strings). More...
 
int bind (const char *name_in, const char *value_in, const char *type_in="")
 Bind a new name to a naming context ( character strings). More...
 
int rebind (const ACE_NS_WString &name_in, const ACE_NS_WString &value_in, const char *type_in="")
 
int rebind (const char *name_in, const char *value_in, const char *type_in="")
 
int unbind (const ACE_NS_WString &name_in)
 
int unbind (const char *name_in)
 
int resolve (const ACE_NS_WString &name_in, ACE_NS_WString &value_out, char *&type_out)
 
int resolve (const char *name_in, ACE_NS_WString &value_out, char *&type_out)
 
int resolve (const char *name_in, char *&value_out, char *&type_out)
 
int list_names (ACE_PWSTRING_SET &set_out, const ACE_NS_WString &pattern_in)
 
int list_names (ACE_PWSTRING_SET &set_out, const char *pattern_in)
 
int list_values (ACE_PWSTRING_SET &set_out, const ACE_NS_WString &pattern_in)
 
int list_values (ACE_PWSTRING_SET &set_out, const char *pattern_in)
 
int list_types (ACE_PWSTRING_SET &set_out, const ACE_NS_WString &pattern_in)
 
int list_types (ACE_PWSTRING_SET &set_out, const char *pattern_in)
 
virtual int list_name_entries (ACE_BINDING_SET &set_out, const ACE_NS_WString &pattern_in)
 
virtual int list_name_entries (ACE_BINDING_SET &set_out, const char *pattern_in)
 
virtual int list_value_entries (ACE_BINDING_SET &set_out, const ACE_NS_WString &pattern_in)
 
virtual int list_value_entries (ACE_BINDING_SET &set_out, const char *pattern_in)
 
virtual int list_type_entries (ACE_BINDING_SET &set_out, const ACE_NS_WString &pattern_in)
 
virtual int list_type_entries (ACE_BINDING_SET &set_out, const char *pattern_in)
 
void dump (void)
 Dump the state of the object. More...
 
- Public Member Functions inherited from ACE_Service_Object
 ACE_Service_Object (ACE_Reactor *=0)
 Constructor. More...
 
virtual ~ACE_Service_Object (void)
 Destructor. More...
 
virtual int suspend (void)
 Temporarily disable a service without removing it completely. More...
 
virtual int resume (void)
 Re-enable a previously suspended service. More...
 
- Public Member Functions inherited from ACE_Event_Handler
virtual ~ACE_Event_Handler (void)
 Destructor is virtual to enable proper cleanup. More...
 
virtual ACE_HANDLE get_handle (void) const
 Get the I/O handle. More...
 
virtual void set_handle (ACE_HANDLE)
 Set the I/O handle. More...
 
virtual int priority (void) const
 
virtual void priority (int priority)
 Set the priority of the Event_Handler. More...
 
virtual int handle_input (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 Called when input events occur (e.g., connection or data). More...
 
virtual int handle_output (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 
virtual int handle_exception (ACE_HANDLE fd=ACE_INVALID_HANDLE)
 Called when an exceptional events occur (e.g., SIGURG). More...
 
virtual int handle_timeout (const ACE_Time_Value &current_time, const void *act=0)
 
virtual int handle_exit (ACE_Process *)
 Called when a process exits. More...
 
virtual int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask)
 
virtual int handle_signal (int signum, siginfo_t *=0, ucontext_t *=0)
 
virtual int resume_handler (void)
 
virtual int handle_qos (ACE_HANDLE=ACE_INVALID_HANDLE)
 
virtual int handle_group_qos (ACE_HANDLE=ACE_INVALID_HANDLE)
 
virtual void reactor (ACE_Reactor *reactor)
 Set the event demultiplexors. More...
 
virtual ACE_Reactorreactor (void) const
 Get the event demultiplexors. More...
 
virtual
ACE_Reactor_Timer_Interface
reactor_timer_interface (void) const
 Get only the reactor's timer related interface. More...
 
virtual Reference_Count add_reference (void)
 Increment reference count on the handler. More...
 
virtual Reference_Count remove_reference (void)
 Decrement reference count on the handler. More...
 
Reference_Counting_Policyreference_counting_policy (void)
 Current Reference_Counting_Policy. More...
 
- Public Member Functions inherited from ACE_Shared_Object
 ACE_Shared_Object (void)
 Constructor. More...
 
virtual ~ACE_Shared_Object (void)
 Destructor. More...
 

Private Member Functions

int local (void)
 1 if we're on the same local machine as the name server, else 0. More...
 

Private Attributes

ACE_Name_Optionsname_options_
 Keep track of the options such as database name etc per Naming Context. More...
 
ACE_Name_Spacename_space_
 Name space (can be either local or remote) dynamically bound. More...
 
ACE_TCHAR hostname_ [MAXHOSTNAMELEN+1]
 Holds the local hostname. More...
 
const ACE_TCHARnetnameserver_host_
 Holds name of net name server. More...
 
int netnameserver_port_
 Holds port number of the net name server. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ACE_Event_Handler
static ACE_THR_FUNC_RETURN read_adapter (void *event_handler)
 
static int register_stdin_handler (ACE_Event_Handler *eh, ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr, int flags=THR_DETACHED)
 
static int remove_stdin_handler (ACE_Reactor *reactor, ACE_Thread_Manager *thr_mgr)
 Performs the inverse of the register_stdin_handler() method. More...
 
- Protected Types inherited from ACE_Event_Handler
typedef ACE_Atomic_Op
< ACE_SYNCH_MUTEX,
Reference_Count
Atomic_Reference_Count
 Typedef for implementation of reference counting. More...
 
- Protected Member Functions inherited from ACE_Event_Handler
 ACE_Event_Handler (ACE_Reactor *=0, int priority=ACE_Event_Handler::LO_PRIORITY)
 Force ACE_Event_Handler to be an abstract base class. More...
 
- Protected Attributes inherited from ACE_Event_Handler
Atomic_Reference_Count reference_count_
 Reference count. More...
 

Detailed Description

Maintaining accesses Name Server Databases. Allows to add NameBindings, change them, remove them and resolve NameBindings.

Manages a Naming Service . That represents a persistent string to string mapping for different scopes. The scope of a ACE_Naming_Context may be either local for the calling process (Note : A process is hereby not identified by it's pid, but by it's argv[0]. So different processes (in UNIX syntax) may access the same NameBindings), global for all processes running on one host or global for all processes on the net (that know the address of the net name server socket). Strings may be plain character strings or Wide character strings. A Name Binding consists of a name string (that's the key), a value string and an optional type string (no wide chars).

Member Enumeration Documentation

Enumerator
PROC_LOCAL 

Name lookup is local to the process.

NODE_LOCAL 

Name lookup is local to the node (host).

NET_LOCAL 

Name lookup is local to the (sub)network.

Constructor & Destructor Documentation

ACE_Naming_Context::ACE_Naming_Context ( void  )

"Do-nothing" constructor.

ACE_Naming_Context::ACE_Naming_Context ( Context_Scope_Type  scope_in,
int  light = 0 
)

Specifies the scope of this namespace, opens and memory-maps the associated file (if accessible) or contacts the dedicated name server process for NET_LOCAL namespace. Note that light specifies whether or not we want to use ACE_Lite_MMap_Memory_Pool. By default we use ACE_MMap_Memory_Pool.

ACE_Naming_Context::~ACE_Naming_Context ( void  )

destructor, do some cleanup :TBD: last dtor should "compress" file

Member Function Documentation

int ACE_Naming_Context::bind ( const ACE_NS_WString name_in,
const ACE_NS_WString value_in,
const char *  type_in = "" 
)

Bind a new name to a naming context (Wide character strings).

int ACE_Naming_Context::bind ( const char *  name_in,
const char *  value_in,
const char *  type_in = "" 
)

Bind a new name to a naming context ( character strings).

int ACE_Naming_Context::close ( void  )

Deletes the instance of Name Space. Must be called before switching name spaces.

int ACE_Naming_Context::close_down ( void  )

Release all resources. Gets called by destructor and fini.

void ACE_Naming_Context::dump ( void  )

Dump the state of the object.

int ACE_Naming_Context::fini ( void  )
virtual

Close down the test when dynamically unlinked.

Reimplemented from ACE_Shared_Object.

int ACE_Naming_Context::info ( ACE_TCHAR **  strp,
size_t  length 
) const
virtual

Returns information about this context.

Reimplemented from ACE_Shared_Object.

int ACE_Naming_Context::init ( int  argc,
ACE_TCHAR argv[] 
)
virtual

Initialize name options and naming context when dynamically linked.

Reimplemented from ACE_Shared_Object.

int ACE_Naming_Context::list_name_entries ( ACE_BINDING_SET set_out,
const ACE_NS_WString pattern_in 
)
virtual

Get a set of names matching a specified pattern (wchars). Matching means the names must begin with the pattern string. Returns the complete binding associated each pattern match.

int ACE_Naming_Context::list_name_entries ( ACE_BINDING_SET set_out,
const char *  pattern_in 
)
virtual

Get a set of names matching a specified pattern (wchars). Matching means the names must begin with the pattern string. Returns the complete binding associated each pattern match.

int ACE_Naming_Context::list_names ( ACE_PWSTRING_SET set_out,
const ACE_NS_WString pattern_in 
)

Get a set of names matching a specified pattern (wchars). Matching means the names must begin with the pattern string.

int ACE_Naming_Context::list_names ( ACE_PWSTRING_SET set_out,
const char *  pattern_in 
)

Get a set of names matching a specified pattern (chars). Matching means the names must begin with the pattern string.

int ACE_Naming_Context::list_type_entries ( ACE_BINDING_SET set_out,
const ACE_NS_WString pattern_in 
)
virtual

Get a set of types matching a specified pattern (wchars). Matching means the types must begin with the pattern string. Returns the complete binding associated each pattern match.

int ACE_Naming_Context::list_type_entries ( ACE_BINDING_SET set_out,
const char *  pattern_in 
)
virtual

Get a set of types matching a specified pattern (wchars). Matching means the types must begin with the pattern string. Returns the complete binding associated each pattern match.

int ACE_Naming_Context::list_types ( ACE_PWSTRING_SET set_out,
const ACE_NS_WString pattern_in 
)

Get a set of types matching a specified pattern (wchars). Matching means the types must begin with the pattern string.

int ACE_Naming_Context::list_types ( ACE_PWSTRING_SET set_out,
const char *  pattern_in 
)

Get a set of types matching a specified pattern (chars). Matching means the types must begin with the pattern string.

int ACE_Naming_Context::list_value_entries ( ACE_BINDING_SET set_out,
const ACE_NS_WString pattern_in 
)
virtual

Get a set of values matching a specified pattern (wchars). Matching means the values must begin with the pattern string. Returns the complete binding associated each pattern match.

int ACE_Naming_Context::list_value_entries ( ACE_BINDING_SET set_out,
const char *  pattern_in 
)
virtual

Get a set of values matching a specified pattern (wchars). Matching means the values must begin with the pattern string. Returns the complete binding associated each pattern match.

int ACE_Naming_Context::list_values ( ACE_PWSTRING_SET set_out,
const ACE_NS_WString pattern_in 
)

Get a set of values matching a specified pattern (wchars). Matching means the values must begin with the pattern string.

int ACE_Naming_Context::list_values ( ACE_PWSTRING_SET set_out,
const char *  pattern_in 
)

Get a set of values matching a specified pattern (chars). Matching means the values must begin with the pattern string.

int ACE_Naming_Context::local ( void  )
private

1 if we're on the same local machine as the name server, else 0.

ACE_Name_Options * ACE_Naming_Context::name_options ( void  )

Returns the ACE_Name_Options associated with the Naming_Context.

int ACE_Naming_Context::open ( Context_Scope_Type  scope_in = ACE_Naming_Context::PROC_LOCAL,
int  light = 0 
)

Specifies the scope of this namespace, opens and memory-maps the associated file (if accessible) or contacts the dedicated name server process for NET_LOCAL namespace. Note that light specifies whether or not we want to use ACE_Lite_MMap_Memory_Pool. By default we use ACE_MMap_Memory_Pool.

int ACE_Naming_Context::rebind ( const ACE_NS_WString name_in,
const ACE_NS_WString value_in,
const char *  type_in = "" 
)

Overwrite the value or type of an existing name in a ACE_Naming_Context or bind a new name to the context, if it didn't exist yet. (Wide character strings interface).

int ACE_Naming_Context::rebind ( const char *  name_in,
const char *  value_in,
const char *  type_in = "" 
)

Overwrite the value or type of an existing name in a ACE_Naming_Context or bind a new name to the context, if it didn't exist yet. ( character strings interface)

int ACE_Naming_Context::resolve ( const ACE_NS_WString name_in,
ACE_NS_WString value_out,
char *&  type_out 
)

Get value and type of a given name binding (Wide chars). The caller is responsible for deleting both value_out> and type_out!

int ACE_Naming_Context::resolve ( const char *  name_in,
ACE_NS_WString value_out,
char *&  type_out 
)

Get value and type of a given name binding (Wide chars output). The caller is responsible for deleting both value_out and type_out!

int ACE_Naming_Context::resolve ( const char *  name_in,
char *&  value_out,
char *&  type_out 
)

Get value and type of a given name binding ( chars ). The caller is responsible for deleting both value_out and type_out!

int ACE_Naming_Context::unbind ( const ACE_NS_WString name_in)

Delete a name from a ACE_Naming_Context (Wide character strings Interface).

int ACE_Naming_Context::unbind ( const char *  name_in)

Delete a name from a ACE_Naming_Context (character strings interface).

Member Data Documentation

ACE_TCHAR ACE_Naming_Context::hostname_[MAXHOSTNAMELEN+1]
private

Holds the local hostname.

ACE_Name_Options* ACE_Naming_Context::name_options_
private

Keep track of the options such as database name etc per Naming Context.

ACE_Name_Space* ACE_Naming_Context::name_space_
private

Name space (can be either local or remote) dynamically bound.

const ACE_TCHAR* ACE_Naming_Context::netnameserver_host_
private

Holds name of net name server.

int ACE_Naming_Context::netnameserver_port_
private

Holds port number of the net name server.


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