Ultimate parent class for all objects in the class library.
More...
#include <object.h>
Inherited by Info, MXRecord, PAdaptiveDelay, PAec, PArgList, PASNObject, PChannel, PColourPair, PConfig, PContainer, PDNS::NAPTRRecord, PDNS::SRVRecord, PDTMFDecoder, PDynaLink, PEthSocket::Frame, PEthSocketThread, PFileInfo, PHTTPAuthority, PHTTPClientAuthentication, PHTTPConnectionInfo, PHTTPField, PHTTPRequest, PHTTPResource, PInterfaceFilter, PIpAccessControlEntry, PIPSocket::Address, PIPSocket::AddressAndPort, PIPSocket::InterfaceEntry, PIPSocket::RouteEntry, PJSON, PKey< T >, PLDAPAttributeBase, PLDAPSchema, PLDAPSession, PLDAPSession::ModAttrib, PLDAPStructBase, PMail, PMultiPartInfo, PNotifierListTemplate< ParamType >, PNotifierListTemplate< P_INT_PTR >, PNotifierListTemplate< PXMLElement & >, PODBC, PODBC::RecordSet, PODBC::Row, PProcessStartup, PReadWriteMutex, PRegularExpression, PSafeCollection, PSafeObject, PSafePtrBase, PSASLClient, PScriptLanguage, PServiceMacro, PSHA1Context, PSmartObject, PSmartPointer, PSNMPVarBindingList, PSOAPClient, PSOAPServerRequestResponse, PSpoolDirectory [private]
, PSSLCertificate, PSSLCertificate::X509_Name, PSSLCertificateFingerprint, PSSLCipherContext, PSSLContext, PSSLDiffieHellman, PSSLPrivateKey, PSync, PSyncQueue< T >, PSyncQueue< PQueuedThreadPool::QueuedWorkerThread::QueuedWork >, PSyncQueue< PThread * >, PThread, PThreadPoolBase, PTime, PTimeInterval, PURL, PURLLoader, PURLScheme, PVideoControlInfo, PVideoFont, PVideoFrameInfo, PVideoInputDevice::Capabilities, PVideoInteractionInfo, PVXMLGrammar, PVXMLNodeHandler, PVXMLPlayable, PVXMLRecordable, PXMLBase, PXMLObject, PXMLRPC, PXMLRPCServerParms, PXMLRPCStructBase, PXMLRPCVariableBase, XMPP::Disco::Item, XMPP::Identity, XMPP::JID, XMPP::MUC::Room, XMPP::MUC::User, XMPP::Roster, and XMPP::Roster::Item.
|
virtual void | PrintOn (ostream &strm) const |
| Output the contents of the object to the stream. More...
|
|
virtual void | ReadFrom (istream &strm) |
| Input the contents of the object from the stream. More...
|
|
ostream & | operator<< (ostream &strm, const PObject &obj) |
| Global function for using the standard << operator on objects descended from PObject. More...
|
|
istream & | operator>> (istream &strm, PObject &obj) |
| Global function for using the standard >> operator on objects descended from PObject. More...
|
|
Ultimate parent class for all objects in the class library.
This provides functionality provided to all classes, eg run-time types, default comparison operations, simple stream I/O and serialisation support.
Result of the comparison operation performed by the Compare()
function.
Enumerator |
---|
LessThan |
|
EqualTo |
|
GreaterThan |
|
Constructor for PObject, made protected so cannot ever create one on its own.
Referenced by Class().
virtual PObject::~PObject |
( |
| ) |
|
|
inlinevirtual |
static __inline const char* PObject::Class |
( |
| ) |
|
|
inlinestatic |
virtual PObject* PObject::Clone |
( |
| ) |
const |
|
virtual |
Create a copy of the class on the heap.
The exact semantics of the descendent class determine what is required to make a duplicate of the instance. Not all classes can even do a clone operation.
The main user of the clone function is the PDictionary
class as it requires copies of the dictionary keys.
The default behaviour is for this function to assert.
- Returns
- pointer to new copy of the class instance.
Reimplemented in PStringDictionary< K >, PStringSet, PStringList, PStringArray, PCaselessString, PHTTPMultiSimpAuth, PHTTPSimpleAuth, POrdinalDictionary< K >, PBitArray, PDictionary< K, D >, PDictionary< XMPP::JID, PNotifierListTemplate< P_INT_PTR > >, PDictionary< PString, XMPP::Presence >, PDictionary< PRFC1155_ObjectName, PRFC1155_ObjectSyntax >, PDictionary< PString, PXMLRPCVariableBase >, PDictionary< PString, PLDAPAttributeBase >, PDictionary< PString, PNotifierListTemplate< P_INT_PTR > >, PDictionary< K, POrdinalKey >, PDictionary< K, PString >, PSortedList< T >, PSortedList< PString >, PArray< T >, PArray< PString >, PArray< PBYTEArray >, PArray< K >, PArray< PXMLRPCVariableBase >, PArray< PXMLObject >, PArray< PODBC::Field >, PBYTEArray, PStack< T >, PCharArray, PSet< T >, PSet< PString >, PQueue< T >, PQueue< PXMLElement >, PASNNull, PString, PASNObjectID, PXMLElement, PASNGauge, PASNCounter, PASNTimeTicks, PXMLData, PList< T >, PList< PHTTPServer >, PList< PString >, PList< PSafeObject >, PList< PMultiPartInfo >, PXMLObject, PASNIPAddress, PSocksUDPSocket, PBaseArray< T >, PBaseArray< int >, PBaseArray< PObject * >, PBaseArray< const char * >, PBaseArray< struct berval * >, PBaseArray< BYTE >, PBaseArray< unsigned >, PBaseArray< DWORD >, PBaseArray< char >, PBaseArray< PHashTableList >, PCriticalSection, PASNString, PSocks5Socket, PASNInteger, PSocks4Socket, PHashTableInfo, PASNObject, PTime, XMPP::BareJID, PTimeInterval, PTCPSocket, XMPP::JID, and PKey< T >.
Referenced by CloneAs(), and PList< PMultiPartInfo >::insert().
template<class CLS >
CLS* PObject::CloneAs |
( |
| ) |
const |
|
inline |
Compare the two objects and return their relative rank.
This function is usually overridden by descendent classes to yield the ranking according to the semantics of the object.
The default function is to use the CompareObjectMemoryDirect()
function to do a byte wise memory comparison of the two objects.
- Returns
LessThan
, EqualTo
or GreaterThan
according to the relative rank of the objects.
Reimplemented in PVideoInputDeviceIndirect, PAbstractSortedList, PSafePtrMultiThreaded, PArrayObjects, PSafePtrBase, PString, PSSLCertificateFingerprint, PHTTPClientDigestAuthentication, PHTTPClientBasicAuthentication, PServiceMacro, MXRecord, PIPSocket::AddressAndPort, PSSLCertificate::X509_Name, PHTTPClientAuthentication, PDNS::SRVRecord, PHashTable, PSmartPointer, PAbstractArray, PProcess, PFile, PTime, PChannel, PTimeInterval, PAbstractList, PIPSocket::Address, PVideoFrameInfo, PURL, PKey< T >, XMPP::MUC::User, PIndirectChannel, PIpAccessControlEntry, PMemoryFile, XMPP::JID, PHTTPField, PColourPair, and PDNS::NAPTRRecord.
Referenced by operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().
template<typename T >
static Comparison PObject::Compare2 |
( |
T |
v1, |
|
|
T |
v2 |
|
) |
| |
|
inlinestatic |
Determine the byte wise comparison of two objects.
This is the default comparison operation for objects that do not explicitly override the Compare()
function.
The PCLASSINFO
macro declares an override of this function for the particular class. The user need not implement it.
- Returns
LessThan
, EqualTo
or GreaterThan
according to the result memcpy()
function.
__inline void PObject::CopyTraceContextIdentifier |
( |
PObject & |
obj | ) |
const |
|
inline |
__inline void PObject::CopyTraceContextIdentifier |
( |
PObject * |
obj | ) |
const |
|
inline |
static __inline void PObject::CopyTraceContextIdentifier |
( |
PObject & |
to, |
|
|
const PObject & |
from |
|
) |
| |
|
inlinestatic |
static __inline void PObject::CopyTraceContextIdentifier |
( |
PObject & |
to, |
|
|
const PObject * |
from |
|
) |
| |
|
inlinestatic |
static __inline void PObject::CopyTraceContextIdentifier |
( |
PObject * |
to, |
|
|
const PObject & |
from |
|
) |
| |
|
inlinestatic |
static __inline void PObject::CopyTraceContextIdentifier |
( |
PObject * |
to, |
|
|
const PObject * |
from |
|
) |
| |
|
inlinestatic |
__inline const char* PObject::GetClass |
( |
| ) |
const |
|
inline |
__inline unsigned PObject::GetTraceContextIdentifier |
( |
| ) |
const |
|
inline |
virtual PINDEX PObject::HashFunction |
( |
| ) |
const |
|
virtual |
This function yields a hash value required by the PDictionary
class.
A descendent class that is required to be the key of a dictionary should override this function. The precise values returned is dependent on the semantics of the class. For example, the PString
class overrides it to provide a hash function for distinguishing text strings.
The default behaviour is to return the value zero.
- Returns
- hash function value for class instance.
Reimplemented in PString, PChannel, PURL, and PKey< T >.
static Comparison PObject::InternalCompareObjectMemoryDirect |
( |
const PObject * |
obj1, |
|
|
const PObject * |
obj2, |
|
|
PINDEX |
size |
|
) |
| |
|
static |
__inline bool PObject::IsClass |
( |
const char * |
name | ) |
const |
|
inline |
bool PObject::operator!= |
( |
const PObject & |
obj | ) |
const |
|
inline |
Compare the two objects.
- Returns
- true if objects are not equal.
References Compare(), and EqualTo.
bool PObject::operator< |
( |
const PObject & |
obj | ) |
const |
|
inline |
Compare the two objects.
- Returns
- true if objects are less than.
References Compare(), and LessThan.
bool PObject::operator<= |
( |
const PObject & |
obj | ) |
const |
|
inline |
Compare the two objects.
- Returns
- true if objects are less than or equal.
References Compare(), and GreaterThan.
bool PObject::operator== |
( |
const PObject & |
obj | ) |
const |
|
inline |
Compare the two objects.
- Returns
- true if objects are equal.
References Compare(), and EqualTo.
bool PObject::operator> |
( |
const PObject & |
obj | ) |
const |
|
inline |
Compare the two objects.
- Returns
- true if objects are greater than.
References Compare(), and GreaterThan.
bool PObject::operator>= |
( |
const PObject & |
obj | ) |
const |
|
inline |
Compare the two objects.
- Returns
- true if objects are greater than or equal.
References Compare(), and LessThan.
virtual void PObject::PrintOn |
( |
ostream & |
strm | ) |
const |
|
virtual |
Output the contents of the object to the stream.
The exact output is dependent on the exact semantics of the descendent class. This is primarily used by the standard operator<<
function.
The default behaviour is to print the class name.
Reimplemented in PVideoInputDeviceIndirect, PVideoInputDevice::Capabilities, PIPSocket::InterfaceEntry, PHexDump, PIPSocket::RouteEntry, PSafePtrBase, PBYTEArray, PCharArray, PASNSequence, PASNNull, PASNObjectID, PLDAPStructBase, PSafeCollection, PCollection, PXMLElement, PVideoDevice, PSSLCertificate, PASNUnsignedInteger, PIPSocket, MXRecord, PVideoInteractionInfo, PSSLCertificate::X509_Name, PIPSocket::AddressAndPort, PReadWriteMutex, PVideoControlInfo, PASNString, PXMLRPCStructBase, PDNS::SRVRecord, PASNInteger, PXMLRPCArrayBase, PIntCondMutex, PTimedMutex, PProcess, PThread, PASNObject, PAbstractArray, PXML, PVideoFrameInfo, PColourConverter, XMPP::JID, PIpAccessControlEntry, PSNMPVarBindingList, and PDNS::NAPTRRecord.
__inline const PObject* PObject::PTraceObjectInstance |
( |
| ) |
const |
|
inline |
static __inline const PObject* PObject::PTraceObjectInstance |
( |
const char * |
| ) |
|
|
inlinestatic |
static __inline const PObject* PObject::PTraceObjectInstance |
( |
const PObject * |
obj | ) |
|
|
inlinestatic |
virtual void PObject::ReadFrom |
( |
istream & |
strm | ) |
|
|
virtual |
__inline void PObject::SetTraceContextIdentifier |
( |
unsigned |
id | ) |
|
|
inline |
__inline void PObject::SetTraceContextIdentifier |
( |
const PObject & |
obj | ) |
|
|
inline |
__inline void PObject::SetTraceContextIdentifier |
( |
const PObject * |
obj | ) |
|
|
inline |
ostream& operator<< |
( |
ostream & |
strm, |
|
|
const PObject & |
obj |
|
) |
| |
|
friend |
Global function for using the standard << operator on objects descended from PObject.
This simply calls the objects PrintOn()
function.
- Returns
- the
strm
parameter.
- Parameters
-
strm | Stream to print the object into. |
obj | Object to print to the stream. |
istream& operator>> |
( |
istream & |
strm, |
|
|
PObject & |
obj |
|
) |
| |
|
friend |
Global function for using the standard >> operator on objects descended from PObject.
This simply calls the objects ReadFrom()
function.
- Returns
- the
strm
parameter.
- Parameters
-
strm | Stream to read the objects contents from. |
obj | Object to read inormation into. |
unsigned PObject::m_traceContextIdentifier |
|
protected |
The documentation for this class was generated from the following file: