PTLib  Version 2.14.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PODBC::Field Class Reference

Class for Field Data. More...

#include <podbc.h>

Inheritance diagram for PODBC::Field:
Collaboration diagram for PODBC::Field:

Public Member Functions

 ~Field ()
 
Fieldoperator= (const Field &other)
 
Fieldoperator= (const PVarType &other)
 
virtual bool SetType (BasicType type, PINDEX options=0)
 Set the basic type. More...
 
void SetDefaultValues ()
 Initialise/Set the Default values for Field of New Record. More...
 
void SetNULL ()
 Set value to NULL. More...
 
bool IsNULL () const
 Is curreently NULL value. More...
 
PINDEX GetColumn () const
 Get column index number, 1 up. More...
 
const PString GetName () const
 Get column name. More...
 
int GetDataType () const
 
unsigned GetScale () const
 
bool IsNullable () const
 
bool IsReadOnly () const
 
bool IsUpdatable () const
 
bool IsAutoIncrement () const
 
bool IsAutoIndex ()
 
unsigned GetPrecision () const
 
bool Post ()
 
- Public Member Functions inherited from PVarType
 PVarType ()
 Create a NULL type object. More...
 
 PVarType (bool value)
 Create a boolean type object. More...
 
 PVarType (char value)
 Create a 8 bit integer type object. More...
 
 PVarType (int16_t value)
 Create a 16 bit integer type object. More...
 
 PVarType (int32_t value)
 Create a 32 bit integer type object. More...
 
 PVarType (int64_t value)
 Create a 64 bit integertype object. More...
 
 PVarType (uint8_t value)
 Create a 8 bit unsigned integer type object. More...
 
 PVarType (uint16_t value)
 Create a 16 bit unsigned integer type object. More...
 
 PVarType (uint32_t value)
 Create a 32 bit unsigned integer type object. More...
 
 PVarType (uint64_t value)
 Create a 64 bit unsigned integer type object. More...
 
 PVarType (float value)
 Create a single precision floating point type object. More...
 
 PVarType (double value)
 Create a double precision floating point type object. More...
 
 PVarType (long double value)
 Create a extended (long double) precision floating point type object. More...
 
 PVarType (const PGloballyUniqueID &value)
 Create a time of day type object. More...
 
 PVarType (const PTime &value)
 Create a time of day type object. More...
 
 PVarType (const char *value, bool dynamic=false)
 Create a string type object. More...
 
 PVarType (const PString &value, bool dynamic=true)
 Create a string type object. More...
 
 PVarType (const void *value, PINDEX len, bool dynamic=false)
 Create a data (memory block) type object. More...
 
 PVarType (const PBYTEArray &value, bool dynamic=true)
 Create a data (memory block) type object. More...
 
 PVarType (const PVarType &other)
 Copy constructor. More...
 
PVarTypeoperator= (bool value)
 Assign a boolean type object. More...
 
PVarTypeoperator= (char value)
 Assign a 8 bit integer type object. More...
 
PVarTypeoperator= (int16_t value)
 Assign a 16 bit integer type object. More...
 
PVarTypeoperator= (int32_t value)
 Assign a 32 bit integer type object. More...
 
PVarTypeoperator= (int64_t value)
 Assign a 64 bit integertype object. More...
 
PVarTypeoperator= (uint8_t value)
 Assign a 8 bit unsigned integer type object. More...
 
PVarTypeoperator= (uint16_t value)
 Assign a 16 bit unsigned integer type object. More...
 
PVarTypeoperator= (uint32_t value)
 Assign a 32 bit unsigned integer type object. More...
 
PVarTypeoperator= (uint64_t value)
 Assign a 64 bit unsigned integer type object. More...
 
PVarTypeoperator= (float value)
 Assign a single precision floating point type object. More...
 
PVarTypeoperator= (double value)
 Assign a double precision floating point type object. More...
 
PVarTypeoperator= (long double value)
 Assign a extended (long double) precision floating point type object. More...
 
PVarTypeoperator= (const PGloballyUniqueID &value)
 Assign a time of day type object. More...
 
PVarTypeoperator= (const PTime &value)
 Assign a time of day type object. More...
 
PVarTypeoperator= (const char *str)
 Assignment operator for strings. More...
 
PVarTypeoperator= (const PString &str)
 Assignment operator for strings. More...
 
PVarTypeoperator= (const PVarType &other)
 Assignment operator. More...
 
 ~PVarType ()
 Destroy the variable type object. More...
 
virtual void PrintOn (ostream &strm) const
 
virtual void ReadFrom (istream &strm)
 
virtual PObjectClone () const
 Create a copy of the class on the heap. More...
 
BasicType GetType () const
 Get the basic type of this instance. More...
 
bool AsBoolean () const
 
int AsInteger () const
 
unsigned AsUnsigned () const
 
int64_t AsInteger64 () const
 
uint64_t AsUnsigned64 () const
 
double AsFloat () const
 
PGloballyUniqueID AsGUID () const
 
PTime AsTime () const
 
PString AsString () const
 
template<typename TYPE >
TYPE As () const
 
template<>
bool As () const
 
template<>
int As () const
 
template<>
unsigned As () const
 
template<>
int64_t As () const
 
template<>
uint64_t As () const
 
template<>
double As () const
 
template<>
PGloballyUniqueID As () const
 
template<>
PTime As () const
 
template<>
PString As () const
 
const void * GetPointer () const
 
PINDEX GetSize () const
 
virtual PVarTypeSetValue (const PString &value)
 Set the instances value without changing it's type. More...
 
virtual PVarTypeSetString (const char *value, bool dynamic)
 
PVarTypeSetStaticString (const char *value)
 
PVarTypeSetDynamicString (const char *value)
 
virtual PVarTypeSetBinary (const void *data, PINDEX len, bool dynamic)
 
PVarTypeSetBinary (const PBYTEArray &value, bool dynamic)
 
PVarTypeSetStaticBinary (const void *data, PINDEX len)
 
PVarTypeSetStaticBinary (const PBYTEArray &value)
 
PVarTypeSetDynamicBinary (const void *data, PINDEX len)
 
PVarTypeSetDynamicBinary (const PBYTEArray &value)
 
- Public Member Functions inherited from PObject
unsigned GetTraceContextIdentifier () const
 Get PTRACE context identifier. More...
 
void SetTraceContextIdentifier (unsigned id)
 
void GetTraceContextIdentifier (PObject &obj)
 
void GetTraceContextIdentifier (PObject *obj)
 
void SetTraceContextIdentifier (const PObject &obj)
 
void SetTraceContextIdentifier (const PObject *obj)
 
virtual ~PObject ()
 
template<class CLS >
CLS * CloneAs () const
 As for Clone() but converts to specified type. More...
 
virtual PINDEX HashFunction () const
 This function yields a hash value required by the PDictionary class. More...
 
virtual const char * GetClass (unsigned ancestor=0) const
 Get the current dynamic type of the object instance. More...
 
PBoolean IsClass (const char *cls) const
 
virtual PBoolean InternalIsDescendant (const char *clsName) const
 Determine if the dynamic type of the current instance is a descendent of the specified class. More...
 
__inline const PObjectPTraceObjectInstance () const
 
virtual Comparison Compare (const PObject &obj) const
 Compare the two objects and return their relative rank. More...
 
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
 Determine the byte wise comparison of two objects. More...
 
bool operator== (const PObject &obj) const
 Compare the two objects. More...
 
bool operator!= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator< (const PObject &obj) const
 Compare the two objects. More...
 
bool operator> (const PObject &obj) const
 Compare the two objects. More...
 
bool operator<= (const PObject &obj) const
 Compare the two objects. More...
 
bool operator>= (const PObject &obj) const
 Compare the two objects. More...
 
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...
 

Protected Member Functions

 Field (Row &row, PINDEX column)
 
virtual void OnGetValue ()
 Called before all the AsXXX() functions execute. More...
 
virtual void OnValueChanged ()
 Called after SetValue() has (possibly) changed the value. More...
 
virtual void InternalCopy (const PVarType &other)
 
- Protected Member Functions inherited from PVarType
void InternalDestroy ()
 
- Protected Member Functions inherited from PObject
 PObject ()
 Constructor for PObject, made protected so cannot ever create one on its own. More...
 

Protected Attributes

Rowm_row
 
PINDEX m_column
 Back Reference to the Row. More...
 
PString m_name
 Column number. More...
 
int m_odbcType
 Column Name. More...
 
unsigned m_scale
 
bool m_isNullable
 
bool m_isReadOnly
 
bool m_isAutoIncrement
 
unsigned m_decimals
 
FieldExtra * m_extra
 Number of decimal places to Round. More...
 
- Protected Attributes inherited from PVarType
BasicType m_type
 Type of parameter. More...
 
union PVarType::Variant m_
 
- Protected Attributes inherited from PObject
unsigned m_traceContextIdentifier
 

Additional Inherited Members

- Public Types inherited from PVarType
enum  BasicType {
  VarNULL, VarBoolean, VarChar, VarInt8,
  VarInt16, VarInt32, VarInt64, VarUInt8,
  VarUInt16, VarUInt32, VarUInt64, VarFloatSingle,
  VarFloatDouble, VarFloatExtended, VarGUID, VarTime,
  VarStaticString, VarFixedString, VarDynamicString, VarStaticBinary,
  VarDynamicBinary
}
 Type of the parameter in Paramater structure. More...
 
- Static Public Member Functions inherited from PObject
static const char * Class ()
 Get the name of the class as a C string. More...
 
static __inline const PObjectPTraceObjectInstance (const char *)
 
static __inline const PObjectPTraceObjectInstance (const PObject *obj)
 
static Comparison InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
 Internal function caled from CompareObjectMemoryDirect() More...
 
- Friends inherited from PObject

Detailed Description

Class for Field Data.

Constructor & Destructor Documentation

PODBC::Field::~Field ( )
PODBC::Field::Field ( Row row,
PINDEX  column 
)
protected

Member Function Documentation

PINDEX PODBC::Field::GetColumn ( ) const
inline

Get column index number, 1 up.

References m_column.

int PODBC::Field::GetDataType ( ) const
inline

References m_odbcType.

Referenced by PODBC::Row::ColumnType().

const PString PODBC::Field::GetName ( ) const
inline

Get column name.

References m_name.

Referenced by PODBC::Row::ColumnName().

unsigned PODBC::Field::GetPrecision ( ) const
inline

References m_decimals.

Referenced by PODBC::Row::ColumnPrecision().

unsigned PODBC::Field::GetScale ( ) const
inline

References m_scale.

Referenced by PODBC::Row::ColumnScale().

virtual void PODBC::Field::InternalCopy ( const PVarType other)
protectedvirtual

Reimplemented from PVarType.

bool PODBC::Field::IsAutoIncrement ( ) const
inline

References m_isAutoIncrement.

Referenced by IsAutoIndex().

bool PODBC::Field::IsAutoIndex ( )
inline
bool PODBC::Field::IsNULL ( ) const

Is curreently NULL value.

bool PODBC::Field::IsNullable ( ) const
inline

References m_isNullable.

Referenced by PODBC::Row::IsColumnNullable().

bool PODBC::Field::IsReadOnly ( ) const
inline

References m_isReadOnly.

Referenced by IsUpdatable().

bool PODBC::Field::IsUpdatable ( ) const
inline

References IsReadOnly().

Referenced by PODBC::Row::IsColumnUpdatable().

virtual void PODBC::Field::OnGetValue ( )
protectedvirtual

Called before all the AsXXX() functions execute.

Reimplemented from PVarType.

virtual void PODBC::Field::OnValueChanged ( )
protectedvirtual

Called after SetValue() has (possibly) changed the value.

Reimplemented from PVarType.

Field& PODBC::Field::operator= ( const Field other)
inline

References PVarType::operator=().

Field& PODBC::Field::operator= ( const PVarType other)
inline

References PVarType::operator=().

bool PODBC::Field::Post ( )
void PODBC::Field::SetDefaultValues ( )

Initialise/Set the Default values for Field of New Record.

void PODBC::Field::SetNULL ( )

Set value to NULL.

virtual bool PODBC::Field::SetType ( BasicType  type,
PINDEX  option = 0 
)
virtual

Set the basic type.

The option argument means different things depending on the type. If VarDynamicString or VarDynamicBinary then this indicates the size of the storage to allocate. If VarTime, then thius is the format to use for AsString().

Reimplemented from PVarType.

Member Data Documentation

PINDEX PODBC::Field::m_column
protected

Back Reference to the Row.

Referenced by GetColumn().

unsigned PODBC::Field::m_decimals
protected

Referenced by GetPrecision().

FieldExtra* PODBC::Field::m_extra
protected

Number of decimal places to Round.

bool PODBC::Field::m_isAutoIncrement
protected

Referenced by IsAutoIncrement().

bool PODBC::Field::m_isNullable
protected

Referenced by IsNullable().

bool PODBC::Field::m_isReadOnly
protected

Referenced by IsReadOnly().

PString PODBC::Field::m_name
protected

Column number.

Referenced by GetName().

int PODBC::Field::m_odbcType
protected

Column Name.

Referenced by GetDataType().

Row& PODBC::Field::m_row
protected
unsigned PODBC::Field::m_scale
protected

Referenced by GetScale().


The documentation for this class was generated from the following file: