Rudiments
Public Member Functions | Static Public Member Functions | List of all members
rpcentry Class Reference

Public Member Functions

 rpcentry ()
 
 rpcentry (const rpcentry &r)
 
rpcentryoperator= (const rpcentry &r)
 
 ~rpcentry ()
 
bool initialize (const char *name)
 
bool initialize (int32_t number)
 
const char * getName () const
 
int32_t getNumber () const
 
const char *const * getAliasList () const
 

Static Public Member Functions

static int32_t getNumber (const char *name)
 
static char * getName (int32_t number)
 
static bool needsMutex ()
 
static void setMutex (threadmutex *mtx)
 

Detailed Description

The rpcentry class provides methods for retrieving entries from the rpc file (/etc/rpc on unix).

Constructor & Destructor Documentation

rpcentry::rpcentry ( )

Creates an instance of the rpcentry class.

rpcentry::rpcentry ( const rpcentry r)

Creates an instance of the rpcentry class that is identical to "r".

rpcentry::~rpcentry ( )

Deletes this instance of the rpcentry class.

Member Function Documentation

const char* const* rpcentry::getAliasList ( ) const

Returns a NULL-terminated list of aliases for the rpc entry.

const char* rpcentry::getName ( ) const

Returns the name of the rpc entry.

static char* rpcentry::getName ( int32_t  number)
static

Convenience method. Sets "name" to the name associated with rpc "number".

Note that the return value is allocated internally and returned. The calling program must free the buffer.

Returns NULL if an error occurred or if "name" is invalid.

int32_t rpcentry::getNumber ( ) const

Returns the number of the rpc entry.

static int32_t rpcentry::getNumber ( const char *  name)
static

Convenience method. Sets "number" to the number associated with rpc "name".

Returns -1 if an error occurred or if "name" is invalid.

bool rpcentry::initialize ( const char *  name)

Looks up a rpc entry by name. Returns true on success and false on failure.

bool rpcentry::initialize ( int32_t  number)

Looks up a rpc entry by number. Returns true on success and false on failure.

static bool rpcentry::needsMutex ( )
static

Returns true if this class needs a mutex to operate safely in a threaded environment and false otherwise.

rpcentry& rpcentry::operator= ( const rpcentry r)

Makes this instance of the rpcentry class identical ot "r".

static void rpcentry::setMutex ( threadmutex mtx)
static

Allows you to supply a mutex is the class needs it. (see needsMutex()). If your application is not multithreaded, then there is no need to supply a mutex.