VxWorks Reference Manual : Wind Foundation Classes
VXWSmName - naming behavior common to all shared memory classes
VXWSmName::~VXWSmName( ) - remove an object from the shared memory objects name database (VxMP Option)
VXWSmName::nameSet( ) - define a name string in the shared-memory name database (VxMP Option)
VXWSmName::nameGet( ) - get name and type of a shared memory object (VxMP Option)
VXWSmName::nameGet( ) - get name of a shared memory object (VxMP Option)
This class library provides facilities for managing entries in the shared memory objects name database. The shared memory objects name database associates a name and object type with a value and makes that information available to all CPUs. A name is an arbitrary, null-terminated string. An object type is a small integer, and its value is a global (shared) ID or a global shared memory address.
Names are added to the shared memory name database with VXWSmName::VXWSmName( ). They are removed by VXWSmName::~VXWSmName( ).
Name database contents can be viewed using smNameShow( ).
The maximum number of names to be entered in the database SM_OBJ_MAX_NAME is defined in configAll.h. This value is used to determine the size of a dedicated shared memory partition from which name database fields are allocated.
The estimated memory size required for the name database can be calculated as follows:
<name database pool size> = SM_OBJ_MAX_NAME * 40 (bytes)The display facility for the shared memory objects name database is provided by smNameShow.
Before routines in this library can be called, the shared memory object facility must be initialized by calling usrSmObjInit( ), which is found in src/config/usrSmObj.c. This is done automatically from the root task, usrRoot( ), in usrConfig.c if INCLUDE_SM_OBJ is defined in configAll.h.
This module depends on code that is distributed as a component of the unbundled shared memory objects support option, VxMP.
vxwSmNameLib.h
VXWSmName, smNameLib, smNameShow, vxwSmLib, smObjShow, usrSmObjInit( ), VxWorks Programmer's Guide: Shared Memory Objects
VXWSmName::~VXWSmName( ) - remove an object from the shared memory objects name database (VxMP Option)
virtual ~VXWSmName ()
This routine removes an object from the shared memory objects name database.
This routine depends on code distributed as a component of the unbundled shared memory objects support option, VxMP.
OK, or ERROR if the database is not initialized, or the name-database lock times out.
S_smNameLib_NOT_INITIALIZED
S_smObjLib_LOCK_TIMEOUT
VXWSmName::nameSet( ) - define a name string in the shared-memory name database (VxMP Option)
virtual STATUS nameSet ( char * name ) = 0
This routine adds a name of the type appropriate for each derived class to the database of memory object names.
The name parameter is an arbitrary null-terminated string with a maximum of 20 characters, including EOS.
A name can be entered only once in the database, but there can be more than one name associated with an object ID.
This routine depends on the unbundled shared memory objects support option, VxMP.
OK, or ERROR if there is insufficient memory for name to be allocated, if name is already in the database, or if the database is already full.
S_smNameLib_NOT_INITIALIZED
S_smNameLib_NAME_TOO_LONG
S_smNameLib_NAME_ALREADY_EXIST
S_smNameLib_DATABASE_FULL
S_smObjLib_LOCK_TIMEOUT
VXWSmName::nameGet( ) - get name and type of a shared memory object (VxMP Option)
STATUS nameGet ( char * name, int * pType, int waitType )
This routine searches the shared memory name database for an object matching this VXWSmName instance. If the object is found, its name and type are copied to the addresses pointed to by name and pType. The value of waitType can be one of the following:
- NO_WAIT (0)
- The call returns immediately, even if the object value is not in the database
- WAIT_FOREVER (-1)
- The call returns only when the object value is available in the database.
This routine depends on the unbundled shared memory objects support option, VxMP.
OK, or ERROR if value is not found or if the wait type is invalid.
S_smNameLib_NOT_INITIALIZED
S_smNameLib_VALUE_NOT_FOUND
S_smNameLib_INVALID_WAIT_TYPE
S_smObjLib_LOCK_TIMEOUT
VXWSmName::nameGet( ) - get name of a shared memory object (VxMP Option)
STATUS nameGet ( char * name, int waitType )
This routine searches the shared memory name database for an object matching this VXWSmName instance. If the object is found, its name is copied to the address pointed to by name. The value of waitType can be one of the following:
- NO_WAIT (0)
- The call returns immediately, even if the object value is not in the database
- WAIT_FOREVER (-1)
- The call returns only when the object value is available in the database.
This routine depends on the unbundled shared memory objects support option, VxMP.
OK, or ERROR if value is not found or if the wait type is invalid.
S_smNameLib_NOT_INITIALIZED
S_smNameLib_VALUE_NOT_FOUND
S_smNameLib_INVALID_WAIT_TYPE
S_smObjLib_LOCK_TIMEOUT