PinPoid Class Reference
List of all members.
|
Public Member Functions |
| ~PinPoid () |
| ~PinPoid () |
Static Public Attributes |
static const char | SEPARATOR_CHAR = ' ' |
Private Member Functions |
void | operator= (const PinPoid &) |
void | operator= (const PinPoid &) |
Private Attributes |
PinBool | m_owns |
poid_t * | m_poidp |
Related Functions |
(Note that these are not member functions.)
|
PCMCPP_API std::ostream & | operator<< (std::ostream &os, PinPoidBase &flist) |
Public Factory Methods |
|
static PinPoidOwner | create (PinPoidDb db, PinPoidTypeConst type, PinPoidId id) |
static PinPoidObserver | createAsObserved (poid_t *pdp) |
static PinPoidObserverConst | createAsObservedConst (poid_t *pdp) |
static PinPoidOwner | createAsOwned (poid_t *pdp) |
Public Factory Methods |
|
static PinPoidOwner | create (PinPoidDb db, PinPoidTypeConst type, PinPoidId id) |
static PinPoidObserver | createAsObserved (poid_t *pdp) |
static PinPoidOwner | createAsOwned (poid_t *pdp) |
Public Member Functions |
|
PinPoidDb | getDb () const |
PinPoidId | getId () const |
PinPoidTypeConst | getTypeConst () const |
PinPoidType | getType () const |
PinPoidRev | getRev () const |
PinBool | isTypeOnly () const |
PinPoidOwner | clone () const |
int | compare (const PinPoidBase &poid, int checkRev=0) const |
PinBool | isEqual (const PinPoidBase &poid, int checkRev=0) const |
void | toString (char buf[], int bufsize, int skiprev=0) const |
PinBool | isNull () const |
const poid_t * | get () const |
poid_t * | get () const |
poid_t * | get () |
poid_t * | release () |
Semi-public constructors and member Functions |
|
| PinPoid () |
void | grab (poid_t *poidp, PinBool owns) |
void | takeFrom (PinPoid &) |
void | copyFrom (const PinPoid &) |
Public Member Functions |
|
PinPoidDb | getDb () const |
PinPoidId | getId () const |
PinPoidTypeConst | getTypeConst () const |
PinPoidType | getType () const |
PinPoidRev | getRev () const |
PinBool | isTypeOnly () const |
PinPoidOwner | clone () const |
int | compare (const PinPoidBase &poid, int checkRev=0) const |
PinBool | isEqual (const PinPoidBase &poid, int checkRev=0) const |
void | toString (char buf[], int bufsize, int skiprev=0) const |
PinBool | isNull () const |
const poid_t * | get () const |
poid_t * | release () |
Semi-public constructors and member Functions |
|
| PinPoid () |
| PinPoid (poid_t *poidp, PinBool owns) |
| PinPoid (const PinPoid &) |
void | takeFrom (PinPoid &) |
void | copyFrom (const PinPoid &) |
Detailed Description
The
PinPoid class manage a C
poid pointer. This class is intended to be used via a PinPoidObserver or PinPoidOwner wrapper class.
Constructor & Destructor Documentation
Make a new PinPoid.
- Warning:
- This is intended for use by PinBase. Use the public factory methods instead.
Make a new PinPoid.
- Warning:
- This is intended for use by PinBase. Use the public factory methods instead.
Make a new PinPoid using the passed in C poid pointer.
- Parameters:
-
| poidp | Pointer to the C poid |
| owns | If 1, then this class takes ownership of the poidp |
- Warning:
- This is intended for use by PinBase. Use the public factory methods instead.
PinPoid::PinPoid |
( |
const PinPoid & |
other |
) |
|
Copy constructor. Takes over the C poid pointer from source object. Releases or destroys the C poid it is currently holding.
- Warning:
- This is intended for use by PinBase. Use the public factory methods instead.
Member Function Documentation
Create a new Poid and access it via the owner C++ wrapper.
- Parameters:
-
| db | Database number |
| type | Storable class type |
| id | Instance id |
- Returns:
- PinPoidOwner Instance of the poid owner wrapper
Create a C++ observer wrapper for a C-style Poid. When the wrapper goes out of scope, the underlying poid will not be deleted.
- Parameters:
-
| poidp | Pointer to the poid to wrap |
- Returns:
- PinPoidObserver Instance of the poid observer wrapper
Create a C++ owner wrapper for a C-style Poid. When the wrapper goes out of scope, the underlying poid will be deleted.
- Parameters:
-
| poidp | Pointer to the poid to wrap |
- Returns:
- PinPoidOwner Instance of the poid owner handle
Get the database piece of the poid.
- Returns:
- PinPoidDb Database piece of the poid
Get the instance id piece of the poid.
- Returns:
- PinPoidId Instance id piece of the poid
Get the class name piece of the poid.
- Returns:
- PinPoidDb Class name piece of the poid
Get the database piece of the poid.
- Returns:
- PinPoidRev Instance revision piece of the poid
PinBool PinPoid::isTypeOnly |
( |
|
) |
const |
Check if the poid is a typeonly poid; in other words.
- Returns:
- Pinbool Returns PIN_BOOLEAN_TRUE if the instance id is either 0 or -1
Make a clone of the poid.
- Returns:
- PinPoidOwner Instance of the new poid owner handle
int PinPoid::compare |
( |
const PinPoidBase & |
poid, |
|
|
int |
checkRev = 0 | |
|
) |
| | const |
Compares this object with the poid that is passed in via an owner or observer wrapper.
- Parameters:
-
| poid | Poid to compare with |
| checkRev | Optional parameter to include the revision for comparison |
- Returns:
- int Returns 0 if they compare
- See also:
- isEqual()
Compares this object with the poid that is passed in via an owner or observer wrapper. This method returns a boolean unlike compare() which acts like strcmp().
- Parameters:
-
| poid | Poid to compare with |
| checkRev | Optional parameter to include the revision for comparison |
- Returns:
- PinBool Returns PIN_BOOLEAN_TRUE if they compare
- See also:
- compare()
void PinPoid::toString |
( |
char |
buf[], |
|
|
int |
bufsize, |
|
|
int |
skiprev = 0 | |
|
) |
| | const |
Return a string representation of the poid.
- Parameters:
-
| buf | Sharacater buffer to hold the result |
| bufsize | Size of the buffer |
| skiprev | Optional parameter, revision is excluded if skiprev is 1 |
Check if the poid is a null poid.
- Returns:
- PinBool True If the underlying C poid is a null pointer or if the database portion of the poid is zero.
const poid_t * PinPoid::get |
( |
|
) |
const |
Get the underlying C poid pointer.
- Warning:
- Useful in situations when invoking safe C functions that in C++ code using this class. Make sure that the poid is not destroyed by the callee.
- See also:
- release()
- Returns:
- poid_t* the underlying C poid pointer
poid_t* PinPoid::get |
( |
|
) |
const |
Take ownership of the underlying C poid pointer.
- Warning:
- Useful in situations when invoking C functions that in C++ code using this class, and there is no reason for this C++ class to manage the C poid pointer. Make sure that the C poid is properly destroyed.
- See also:
- get()
Make a new PinPoid using the passed in C poid pointer.
- Parameters:
-
| poidp | Pointer to the C poid |
| owns | If 1, then this class takes ownership of the poidp |
- Warning:
- This is intended for use by PinBase. Use the public factory methods instead.
void PinPoid::takeFrom |
( |
PinPoid & |
other |
) |
|
Takes over the C poid pointer from the source object. Releases or destroys the C poid it is currently holding.
- Warning:
- This is intended for use by PinBase.
- See also:
- copyFrom()
void PinPoid::copyFrom |
( |
const PinPoid & |
other |
) |
|
Points to the C poid pointer from the source object. Releases or destroys the C poid it is currently holding.
- Warning:
- This is intended for use by PinBase.
- See also:
- takeFrom()
void PinPoid::operator= |
( |
const PinPoid & |
|
) |
[private] |
Assignment operator explicitly prohibited.
Create a new Poid and access it via the owner C++ wrapper.
- Parameters:
-
| db | Database number |
| type | Storable class type |
| id | Instance id |
- Returns:
- PinPoidOwner Instance of the poid owner wrapper
Create a C++ observer wrapper for a C-style Poid. When the wrapper goes out of scope, the underlying poid will not be deleted.
- Parameters:
-
| poidp | Pointer to the poid to wrap |
- Returns:
- PinPoidObserver Instance of the poid observer wrapper
Create a C++ owner wrapper for a C-style Poid. When the wrapper goes out of scope, the underlying poid will be deleted.
- Parameters:
-
| poidp | Pointer to the poid to wrap |
- Returns:
- PinPoidOwner Instance of the poid owner handle
Get the database piece of the poid.
- Returns:
- PinPoidDb Database piece of the poid
Get the instance id piece of the poid.
- Returns:
- PinPoidId Instance id piece of the poid
Get the class name piece of the poid.
- Returns:
- PinPoidDb Class name piece of the poid
Get the database piece of the poid.
- Returns:
- PinPoidRev Instance revision piece of the poid
PinBool PinPoid::isTypeOnly |
( |
|
) |
const |
Check if the poid is a typeonly poid; in other words.
- Returns:
- Pinbool Returns PIN_BOOLEAN_TRUE if the instance id is either 0 or -1
Make a clone of the poid.
- Returns:
- PinPoidOwner Instance of the new poid owner handle
int PinPoid::compare |
( |
const PinPoidBase & |
poid, |
|
|
int |
checkRev = 0 | |
|
) |
| | const |
Compares this object with the poid that is passed in via an owner or observer wrapper.
- Parameters:
-
| poid | Poid to compare with |
| checkRev | Optional parameter to include the revision for comparison |
- Returns:
- int Returns 0 if they compare
- See also:
- isEqual()
Compares this object with the poid that is passed in via an owner or observer wrapper. This method returns a boolean unlike compare() which acts like strcmp().
- Parameters:
-
| poid | Poid to compare with |
| checkRev | Optional parameter to include the revision for comparison |
- Returns:
- PinBool Returns PIN_BOOLEAN_TRUE if they compare
- See also:
- compare()
void PinPoid::toString |
( |
char |
buf[], |
|
|
int |
bufsize, |
|
|
int |
skiprev = 0 | |
|
) |
| | const |
Return a string representation of the poid.
- Parameters:
-
| buf | Sharacater buffer to hold the result |
| bufsize | Size of the buffer |
| skiprev | Optional parameter, revision is excluded if skiprev is 1 |
Check if the poid is a null poid.
- Returns:
- PinBool True If the underlying C poid is a null pointer or if the database portion of the poid is zero.
const poid_t* PinPoid::get |
( |
|
) |
const |
Get the underlying C poid pointer.
- Warning:
- Useful in situations when invoking safe C functions that in C++ code using this class. Make sure that the poid is not destroyed by the callee.
- See also:
- release()
- Returns:
- poid_t* the underlying C poid pointer
Take ownership of the underlying C poid pointer.
- Warning:
- Useful in situations when invoking C functions that in C++ code using this class, and there is no reason for this C++ class to manage the C poid pointer. Make sure that the C poid is properly destroyed.
- See also:
- get()
void PinPoid::takeFrom |
( |
PinPoid & |
|
) |
|
Takes over the C poid pointer from the source object. Releases or destroys the C poid it is currently holding.
- Warning:
- This is intended for use by PinBase.
- See also:
- copyFrom()
void PinPoid::copyFrom |
( |
const PinPoid & |
|
) |
|
Points to the C poid pointer from the source object. Releases or destroys the C poid it is currently holding.
- Warning:
- This is intended for use by PinBase.
- See also:
- takeFrom()
void PinPoid::operator= |
( |
const PinPoid & |
|
) |
[private] |
Assignment operator explicitly prohibited.
Friends And Related Function Documentation
PCMCPP_API std::ostream & operator<< |
( |
std::ostream & |
os, |
|
|
PinPoidBase & |
flist | |
|
) |
| | [related] |
Write the string form of the poid to the output stream.
Member Data Documentation
Character separating the various pieces of a stringified poid.
Indicator whether or not the C poid pointer is owned by this obj.
pointer to the underlying C-style poid