Webmaster  |  Imprint 
Platinum
Platinum C++ Framework
Main  |  License  |  Documentation  |  Download  |  Support 

Pt Namespace Reference

Core module. More...


Classes

class  Callable
 An interface for all callable entities. More...
class  ConstMethod
 Adapter for const class methods. More...
class  ConstMethodSlot
 Wraps ConstMethod objects so that they can act as Slots. More...
class  Delegate
 Connects to one slot and handle return value. More...
class  Function
 Wraps free functions into a generic callable for use with the signals/slots framework. More...
class  FunctionSlot
 Wraps Function objects so that they can act as slots. More...
class  Invokable
 Interface for invokable entities. More...
class  Method
 Adapter for class methods. More...
class  MethodSlot
 Wraps Method objects so that they can act as Slots. More...
class  Signal
 Multicast Signal. More...
class  Slot
 Endpoint of a signal/slot connection. More...
class  BasicSlot
 Base type for various "slot" types. More...
class  Allocator
class  Any
 Contains an arbitrary type. More...
class  Application
class  Arg
 Read and extract commandline parameters from argc/argv. More...
class  Arg< bool >
 specialization for bool. More...
class  Arg< const char * >
 Special handling for "const char*". More...
class  Char
 A lightweight Character class (32 bits). More...
class  Connectable
 Connection management for signal and slot objects More...
class  ConnectionData
class  Connection
 Represents a connection between a Signal/Delegate and a slot. More...
class  ConversionError
struct  Convert
class  InvalidDate
class  Date
 Date expressed in year, month, and day More...
class  DateTime
 Combined Date and Time value. More...
class  DelegateBase
class  Deserializer
class  Event
 Base class for all event types. More...
struct  InitLocale
class  Callback
class  NonCopyable
 Protects derived classes from being copied. More...
class  RefCounted
class  SerializationError
 Error during serialization of a type. More...
class  SerializationInfo
class  Serializer
class  SettingsError
class  Settings
class  SignalBase
struct  CompareEventTypeInfo
class  Singleton
 Singleton class template. More...
class  RefLinked
 Reference linking. More...
class  InternalRefCounted
 Intrusive reference counting. More...
class  ExternalRefCounted
 Non-intrusive reference counting. More...
class  DeletePolicy
 deleter policy for smart pointer More...
class  Free
class  SmartPtr
 Policy based smart pointer. The SmartPtr implements a model that determines how the contained raw pointer is managed. The default model is RefCounted, which uses a non-intrusive reference counting mechanism. A model-policy needs to implement two functions called link() and unlink() to manage a raw pointer. The DestroyPolicy implements the method for destroying the object once the smart pointer detects, that the object needs to be freed. By default the object is destroyed by deleting it, but this can be overridden by implementing a different DestroyPolicy. The DestroyPolicy needs to implement a method destroy(T*), which releases the underlying pointer. More...
class  SourceInfo
 Source code info class. More...
class  StringData
class  StringList
 List of unicode capable strings. More...
class  BasicStringStreamBuffer
class  Base64Codec
class  InvalidTime
class  Time
 Time expressed in hours, minutes, seconds and milliseconds More...
class  Timespan
 Represents time spans up to microsecond resolution. More...
struct  TypeTraitsBase
struct  TypeTraits
 Type-traits for for non-const value types. More...
struct  TypeTraits< const T >
 Type-traits for for const value types. More...
struct  TypeTraits< T & >
 Type-traits for for non-const reference types. More...
struct  TypeTraits< const T & >
 Type-traits for for const reference types. More...
struct  TypeTraits< T * >
 Type-traits for for non-const pointer types. More...
struct  TypeTraits< const T * >
 Type-traits for for const pointer types. More...
struct  TypeTraits< T[N]>
 Type-traits for for fixed-size array types. More...
struct  TypeTraits< void >
 Type-traits for for void. More...
class  Variant
class  Vector2d
 A dynamic two dimensional array. More...
struct  Void
 Void type. More...
struct  TypeTraits< Void >
 Void compile time type information. More...
class  Arg< std::string >
 Special handling for std::string. More...
class  Signal< const Pt::Event & >
struct  TypeTraits< Pt::StringList >

Namespaces

namespace  Db
 Transparent Database Access.
namespace  Gfx
 Graphics and Imaging.
namespace  Gui
 Graphic User Interfaces.
namespace  Log
 Configurable and thread-safe logging framework.
namespace  Reflex
 Object introspection, reflection and meta-objects.
namespace  System
 System programming
namespace  Text
 Test Processing.
namespace  Unit
 Protocol and data driven Unit-testing.

Typedefs

typedef long atomic_t
typedef std::basic_string
< Pt::Char
String
 Unicode capable strings.
typedef
std::basic_stringstream
< Pt::Char
StringStream
typedef unsigned char uchar
 
typedef unsigned short ushort
 
typedef unsigned int uint
 
typedef unsigned long ulong
 
typedef std::ptrdiff_t ssize_t
 
typedef signed char int8_t
 
typedef unsigned char uint8_t
 

Functions

template<class R, class BaseT, class C, typename ARGS>
ConstMethod< R, C, ARGS > callable (C &obj, R(BaseT::*ptr)(ARGS) const )
 Returns a ConstMethod object for the given object/method pair.
template<class R, class BaseT, class C, typename ARGS>
ConstMethodSlot< R, C, ARGS > slot (C &obj, R(BaseT::*memFunc)(ARGS) const )
 Returns a slot object for the given object/member pair.
template<typename R, typename ARGS>
Function< R, ARGS > callable (R(*func)(ARGS))
 Returns a Function wrapper for the given free/static function.
template<typename R, typename ARGS>
FunctionSlot< R, ARGS > slot (R(*func)(ARGS))
 Returns a slot object for the given free/static function.
template<class R, class BaseT, class ClassT, typename ARGS>
Method< R, ClassT, ARGS > callable (ClassT &obj, R(BaseT::*ptr)(ARGS))
 Returns a Method object for the given object/method pair.
template<class R, class BaseT, class ClassT, typename ARGS>
MethodSlot< R, ClassT, ARGS > slot (ClassT &obj, R(BaseT::*memFunc)(ARGS))
 Returns a slot object for the given object/member pair.
template<typename T>
any_cast (const Any &any)
 Get contained value.
atomic_t atomicGet (volatile atomic_t &val)
 Atomically get a value.
void atomicSet (volatile atomic_t &val, atomic_t n)
 Atomically set a value.
atomic_t atomicIncrement (volatile atomic_t &val)
 Increases a value by one as an atomic operation.
atomic_t atomicDecrement (volatile atomic_t &val)
 Decreases a value by one as an atomic operation.
atomic_t atomicExchangeAdd (volatile atomic_t &val, atomic_t add)
 Performs atomic addition of two values.
atomic_t atomicExchange (volatile atomic_t &val, atomic_t exch)
 Performs an atomic exchange operation.
void * atomicExchange (void *volatile &dest, void *exch)
 Performs an atomic exchange operation.
atomic_t atomicCompareExchange (volatile atomic_t &val, atomic_t exch, atomic_t comp)
 Performs an atomic compare-and-exchange operation.
void * atomicCompareExchange (void *volatile &ptr, void *exch, void *comp)
 Performs an atomic compare-and-exchange operation.
template<typename T>
T * atomicExchange (T *volatile &dest, T *exch)
template<typename T>
swab16 (T value)
 Swaps the byteorder of the given 16-bit value.
template<typename T>
swab32 (T value)
 Swaps the byteorder of the given 32-bit value.
int8_t swab (int8_t value)
 Dummy function which does nothing.
uint8_t swab (uint8_t value)
 Dummy function which does nothing.
int16_t swab (int16_t value)
 Swaps the byteorder of an int16_t.
uint16_t swab (uint16_t value)
 Swaps the byteorder of a uint16_t.
int32_t swab (int32_t value)
 Swaps the byteorder of an int32_t.
uint32_t swab (uint32_t value)
 Swaps the byteorder of a uint32_t.
bool isBigEndian ()
 Returns true, if the cpu is big-endian (high-byte first).
bool isLittleEndian ()
 Returns true, if the cpu is little-endian (low-byte first).
template<typename T>
hostToLe (const T &value)
 Changes the byteorder of a given value from host-byteorder to little-endian.
template<typename T>
leToHost (const T &value)
 Changes the byteorder of a given value from little-endian to host-byteorder.
template<typename T>
hostToBe (const T &value)
 Changes the given value from the host-byteorder to big-endian.
template<typename T>
beToHost (const T &value)
 Changes the byteorder of a given value from big-endian to host-byteorder.
template<typename T>
void convert (Pt::String &s, const T &value)
template<typename T>
void convert (T &t, const Pt::String &str)
template<typename T>
void convert (std::string &s, const T &value)
template<typename T>
void convert (T &t, const std::string &str)
void convert (Pt::String &s, const Pt::String &str)
void convert (Pt::String &s, bool value)
void convert (bool &n, const Pt::String &str)
void convert (Pt::String &s, char value)
void convert (char &n, const Pt::String &str)
void convert (Pt::String &s, unsigned char value)
void convert (unsigned char &n, const Pt::String &str)
void convert (Pt::String &s, signed char value)
void convert (signed char &n, const Pt::String &str)
void convert (Pt::String &s, const std::string &value)
void convert (std::string &s, const Pt::String &str)
void convert (Pt::String &s, float value)
void convert (float &n, const Pt::String &str)
void convert (Pt::String &s, double value)
void convert (double &n, const Pt::String &str)
template<typename T, typename S>
void convert (T &to, const S &from)
template<typename T, typename S>
convert (const S &from)
PT_API void operator>>= (const SerializationInfo &si, Date &date)
PT_API void operator<<= (SerializationInfo &si, const Date &date)
Date operator+ (const Date &d, int days)
Date operator+ (int days, const Date &d)
int operator- (const Date &a, const Date &b)
PT_API void operator>>= (const SerializationInfo &si, DateTime &dt)
PT_API void operator<<= (SerializationInfo &si, const DateTime &dt)
template<typename T>
void operator>>= (const Pt::SerializationInfo &si, T &x)
template<typename T>
void operator<<= (Pt::SerializationInfo &si, const T &x)
void operator>>= (const SerializationInfo &si, bool &n)
void operator<<= (SerializationInfo &si, bool n)
void operator>>= (const SerializationInfo &si, signed char &n)
void operator<<= (SerializationInfo &si, signed char n)
void operator>>= (const SerializationInfo &si, unsigned char &n)
void operator<<= (SerializationInfo &si, unsigned char n)
void operator>>= (const SerializationInfo &si, char &n)
void operator<<= (SerializationInfo &si, char n)
void operator>>= (const SerializationInfo &si, short &n)
void operator<<= (SerializationInfo &si, short n)
void operator>>= (const SerializationInfo &si, unsigned short &n)
void operator<<= (SerializationInfo &si, unsigned short n)
void operator>>= (const SerializationInfo &si, int &n)
void operator<<= (SerializationInfo &si, int n)
void operator>>= (const SerializationInfo &si, unsigned int &n)
void operator<<= (SerializationInfo &si, unsigned int n)
void operator>>= (const SerializationInfo &si, long &n)
void operator<<= (SerializationInfo &si, long n)
void operator>>= (const SerializationInfo &si, unsigned long &n)
void operator<<= (SerializationInfo &si, unsigned long n)
void operator>>= (const SerializationInfo &si, float &n)
void operator<<= (SerializationInfo &si, float n)
void operator>>= (const SerializationInfo &si, double &n)
void operator<<= (SerializationInfo &si, double n)
void operator>>= (const SerializationInfo &si, std::string &n)
void operator<<= (SerializationInfo &si, const std::string &n)
void operator>>= (const SerializationInfo &si, Pt::String &n)
void operator<<= (SerializationInfo &si, const Pt::String &n)
template<typename T>
void operator>>= (const SerializationInfo &si, std::vector< T > &vec)
template<typename T>
void operator<<= (SerializationInfo &si, const std::vector< T > &vec)
void operator>>= (const SerializationInfo &si, std::vector< int > &vec)
void operator<<= (SerializationInfo &si, const std::vector< int > &vec)
std::string operator+ (const std::string &what, const SourceInfo &info)
std::string operator+ (const char *what, const SourceInfo &info)
std::string operator+ (const SourceInfo &info, const std::string &what)
std::string operator+ (const SourceInfo &info, const char *what)
PT_API void operator>>= (const SerializationInfo &si, Time &time)
PT_API void operator<<= (SerializationInfo &si, const Time &time)
void swap (Timespan &s1, Timespan &s2)
std::ostream & operator<< (std::ostream &os, const Variant &var)
std::istream & operator>> (std::istream &is, Variant &var)
std::basic_ostream< Pt::Char > & operator<< (std::basic_ostream< Pt::Char > &os, const Variant &var)
std::basic_istream< Pt::Char > & operator>> (std::basic_istream< Pt::Char > &is, Variant &var)


Detailed Description

This module is the base module for all other modules and has no dependency to any system specific libraries except the standard c++ library. It provides some basic types, support for byte-order handling, atomic integer operations, type-traits, an unicode string and character class, serialization and a signals/delegates based callback mechanism.

Function Documentation

T Pt::any_cast ( const Any &  any  ) 

This function is used to get the contained value from an Any. It is not possible to get a float out of an Any if the contained value is an int, but the typeid's must match. It is, however, possible to get a const reference to the contained type.

Parameters:
any Any to read to
Returns:
contained value
Exceptions:
std::bad_cast on type mismatch

void * atomicCompareExchange ( void *volatile &  ptr,
void *  exch,
void *  comp 
)

If ptr is equal to comp, ptr is replaced by exch. The initial value of ptr is returned.

atomic_t atomicCompareExchange ( volatile atomic_t &  val,
atomic_t  exch,
atomic_t  comp 
)

If val is equal to comp, val is replaced by exch. The initial value of of val is returned.

atomic_t atomicDecrement ( volatile atomic_t &  val  ) 

Returns the resulting decremented value.

void * atomicExchange ( void *volatile &  dest,
void *  exch 
)

Sets dest to exch and returns the initial value of dest.

atomic_t atomicExchange ( volatile atomic_t &  val,
atomic_t  exch 
)

Sets val to exch and returns the initial value of val.

atomic_t atomicExchangeAdd ( volatile atomic_t &  val,
atomic_t  add 
)

Returns the initial value of the addend.

atomic_t atomicGet ( volatile atomic_t &  val  ) 

Returns the value after employing a memory fence.

atomic_t atomicIncrement ( volatile atomic_t &  val  ) 

Returns the resulting incremented value.

void atomicSet ( volatile atomic_t &  val,
atomic_t  n 
)

Sets the value and employs a memory fence.

T Pt::beToHost ( const T &  value  ) 

Parameters:
value The value in host-byteorder
Returns:
The value in big-endian
This function does nothing on a BE system, but calls swap() on a LE system. The generic swap() function expects the type passed in to be bitwise-copyable and thus does this function. Overloading swab can remove this restriction and may improve performance for custon types.

T Pt::hostToBe ( const T &  value  ) 

Parameters:
value The value in host-byteorder
Returns:
The value in big-endian
This function does nothing on a BE system, but calls swap() on a LE system. The generic swap() function expects the type passed in to be bitwise-copyable and thus does this function. Overloading swab can remove this restriction and may improve performance for custon types.

T Pt::hostToLe ( const T &  value  ) 

Parameters:
value The value in host-byteorder
Returns:
The value changed to little-endian
This function does nothing on a LE system, but calls swap() on a BE system. The generic swap() function expects the type passed in to be bitwise-copyable and thus does this function. Overloading swab can remove this restriction and may improve performance for custon types.

T Pt::leToHost ( const T &  value  ) 

Parameters:
value The value in host-byteorder
Returns:
The value changed to little-endian
This function does nothing on a LE system, but calls swap() on a BE system. The generic swap() function expects the type passed in to be bitwise-copyable and thus does this function. Overloading swab can remove this restriction and may improve performance for custon types.

std::ostream& Pt::operator<< ( std::ostream &  os,
const Variant &  var 
)

Copies var to os and returns os.

std::istream& Pt::operator>> ( std::istream &  is,
Variant &  var 
)

Reads from is UNTIL END OF FILE, stores all of the data in var, and returns is.

uint32_t Pt::swab ( uint32_t  value  ) 

Parameters:
value The value to be byte-swapped
Returns:
The byte-swapped value
Overloads the generic swap().

int32_t Pt::swab ( int32_t  value  ) 

Parameters:
value The value to be byte-swapped
Returns:
The byte-swapped value
Overloads the generic swap().

uint16_t Pt::swab ( uint16_t  value  ) 

Parameters:
value The value to be byte-swapped
Returns:
The byte-swapped value
Overloads the generic swap().

int16_t Pt::swab ( int16_t  value  ) 

Parameters:
value The value to be byte-swapped
Returns:
The byte-swapped value
Overloads the generic swap().

uint8_t Pt::swab ( uint8_t  value  ) 

Just for the sake of completeness.

int8_t Pt::swab ( int8_t  value  ) 

Just for the sake of completeness.

Copyright © 2003-2007 The Pt Development Team
Pt 1.0