VxWorks Reference Manual : Wind Foundation Classes

VXWSmName

NAME

VXWSmName - naming behavior common to all shared memory classes

METHODS

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)

DESCRIPTION

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.

CONFIGURATION

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.

AVAILABILITY

This module depends on code that is distributed as a component of the unbundled shared memory objects support option, VxMP.

INCLUDE FILES

vxwSmNameLib.h

SEE ALSO

VXWSmName, smNameLib, smNameShow, vxwSmLib, smObjShow, usrSmObjInit( ), VxWorks Programmer's Guide: Shared Memory Objects


Wind Foundation Classes : Methods

VXWSmName::~VXWSmName( )

NAME

VXWSmName::~VXWSmName( ) - remove an object from the shared memory objects name database (VxMP Option)

SYNOPSIS

    virtual ~VXWSmName ()

DESCRIPTION

This routine removes an object from the shared memory objects name database.

AVAILABILITY

This routine depends on code distributed as a component of the unbundled shared memory objects support option, VxMP.

RETURNS

OK, or ERROR if the database is not initialized, or the name-database lock times out.

ERRNO

 S_smNameLib_NOT_INITIALIZED  
 S_smObjLib_LOCK_TIMEOUT

SEE ALSO

VXWSmName


Wind Foundation Classes : Methods

VXWSmName::nameSet( )

NAME

VXWSmName::nameSet( ) - define a name string in the shared-memory name database (VxMP Option)

SYNOPSIS

virtual STATUS nameSet
    (
    char * name
    ) = 0

DESCRIPTION

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.

AVAILABILITY

This routine depends on the unbundled shared memory objects support option, VxMP.

RETURNS

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.

ERRNO

 S_smNameLib_NOT_INITIALIZED  
 S_smNameLib_NAME_TOO_LONG  
 S_smNameLib_NAME_ALREADY_EXIST 
 S_smNameLib_DATABASE_FULL 
 S_smObjLib_LOCK_TIMEOUT

SEE ALSO

VXWSmName


Wind Foundation Classes : Methods

VXWSmName::nameGet( )

NAME

VXWSmName::nameGet( ) - get name and type of a shared memory object (VxMP Option)

SYNOPSIS

STATUS nameGet
    (
    char * name,
    int *  pType,
    int    waitType
    )

DESCRIPTION

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.

AVAILABILITY

This routine depends on the unbundled shared memory objects support option, VxMP.

RETURNS

OK, or ERROR if value is not found or if the wait type is invalid.

ERRNO

 S_smNameLib_NOT_INITIALIZED 
 S_smNameLib_VALUE_NOT_FOUND 
 S_smNameLib_INVALID_WAIT_TYPE  
 S_smObjLib_LOCK_TIMEOUT

SEE ALSO

VXWSmName


Wind Foundation Classes : Methods

VXWSmName::nameGet( )

NAME

VXWSmName::nameGet( ) - get name of a shared memory object (VxMP Option)

SYNOPSIS

STATUS nameGet
    (
    char * name,
    int    waitType
    )

DESCRIPTION

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.

AVAILABILITY

This routine depends on the unbundled shared memory objects support option, VxMP.

RETURNS

OK, or ERROR if value is not found or if the wait type is invalid.

ERRNO

 S_smNameLib_NOT_INITIALIZED 
 S_smNameLib_VALUE_NOT_FOUND 
 S_smNameLib_INVALID_WAIT_TYPE  
 S_smObjLib_LOCK_TIMEOUT

SEE ALSO

VXWSmName