Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

plist::RGBColor< T > Class Template Reference

#include <plistSpecialty.h>

Inheritance diagram for plist::RGBColor< T >:

Detailed Description

template<class T>
class plist::RGBColor< T >

Definition at line 237 of file plistSpecialty.h.

List of all members.

Public Member Functions

 RGBColor ()
 RGBColor (T r, T g, T b, T a=getMax())
virtual void loadXML (xmlNode *node)
 This specialization looks for the SensorInfo::sensorType, then has the factory construct the correct subtype before loading the node into and returning that.
virtual void saveXML (xmlNode *node) const
 subclasses are expected to provide a working implementation
virtual void set (const RGBColor< T > &x)
virtual void set (const plist::ObjectBase &x)
 polymorphic assignment (throws std::bad_cast if the assignment is between invalid types, i.e. a primitive and a collection, or different collection types)
virtual void set (const std::string &str)
plist::Primitive< T > & operator[] (int i)
const plist::Primitive< T > & operator[] (int i) const
virtual std::string toString () const
 return current value as a string
virtual size_t size () const
 return the size of the dictionary
virtual void clear ()
 remove all entries in one fell swoop
ObjectBaseresolveEntry (const std::string &s) const
 returns a pointer to entry with the specified 'path', which may recurse through sub-collections
unsigned int getLongestKeyLen (const regex_t *reg, unsigned int depth) const
 returns the length of the longest key, subject to an optional regular expression and max depth
virtual bool canContain (const ObjectBase &obj)
 returns true if the Collection subclass allows storage of the argument
virtual RGBColorclone () const __attribute__((warn_unused_result))
 clone implementation for Dictionary
template<>
float getMax ()
template<>
double getMax ()
template<>
unsigned char fromByte (unsigned char x)
template<>
char fromByte (unsigned char x)
template<>
float fromByte (unsigned char x)
template<>
double fromByte (unsigned char x)
template<>
float fromReal (double x)
template<>
double fromReal (double x)
template<>
void setNumeric (plist::Primitive< char > &n)
template<>
void setNumeric (plist::Primitive< unsigned char > &n)

Public Attributes

plist::Primitive< T > red
plist::Primitive< T > green
plist::Primitive< T > blue
plist::Primitive< T > alpha

Protected Member Functions

virtual void fireEntryRemoved (ObjectBase &val)
 run through collectionListeners, calling CollectionListener::plistCollectionEntryRemoved(*this,val)
void init ()

Static Protected Member Functions

static float makeFloat (const T &v)
static int makeInt (const T &v)
static T fromByte (unsigned char x)
static T fromReal (double x)
static T getMax ()
static void setNumeric (plist::Primitive< T > &)

Constructor & Destructor Documentation

template<class T>
plist::RGBColor< T >::RGBColor (  ) 

Definition at line 239 of file plistSpecialty.h.

template<class T>
plist::RGBColor< T >::RGBColor ( r,
g,
b,
a = getMax() 
)

Definition at line 240 of file plistSpecialty.h.


Member Function Documentation

template<class T>
virtual bool plist::RGBColor< T >::canContain ( const ObjectBase obj  )  [virtual]

returns true if the Collection subclass allows storage of the argument

Reimplemented from plist::DictionaryOf< plist::Primitive< T > >.

Definition at line 276 of file plistSpecialty.h.

template<class T>
virtual void plist::RGBColor< T >::clear (  )  [virtual]

remove all entries in one fell swoop

Reimplemented from plist::DictionaryBase.

Definition at line 265 of file plistSpecialty.h.

template<typename T >
RGBColor< T > * plist::RGBColor< T >::clone (  )  const [virtual]

clone implementation for Dictionary

Reimplemented from plist::DictionaryOf< plist::Primitive< T > >.

Definition at line 498 of file plistSpecialty.h.

template<class T >
void plist::RGBColor< T >::fireEntryRemoved ( ObjectBase val  )  [protected, virtual]

run through collectionListeners, calling CollectionListener::plistCollectionEntryRemoved(*this,val)

Reimplemented from plist::DictionaryBase.

Definition at line 500 of file plistSpecialty.h.

template<>
double plist::RGBColor< double >::fromByte ( unsigned char  x  ) 

Definition at line 314 of file plistSpecialty.h.

template<>
float plist::RGBColor< float >::fromByte ( unsigned char  x  ) 

Definition at line 313 of file plistSpecialty.h.

template<>
char plist::RGBColor< char >::fromByte ( unsigned char  x  ) 

Definition at line 312 of file plistSpecialty.h.

template<>
unsigned char plist::RGBColor< unsigned char >::fromByte ( unsigned char  x  ) 

Definition at line 311 of file plistSpecialty.h.

template<class T>
static T plist::RGBColor< T >::fromByte ( unsigned char  x  )  [static, protected]

Definition at line 285 of file plistSpecialty.h.

Referenced by plist::RGBColor< T >::set().

template<>
double plist::RGBColor< double >::fromReal ( double  x  ) 

Definition at line 317 of file plistSpecialty.h.

template<>
float plist::RGBColor< float >::fromReal ( double  x  ) 

Definition at line 316 of file plistSpecialty.h.

template<class T>
static T plist::RGBColor< T >::fromReal ( double  x  )  [static, protected]

Definition at line 286 of file plistSpecialty.h.

Referenced by plist::RGBColor< T >::set().

template<class T>
unsigned int plist::RGBColor< T >::getLongestKeyLen ( const regex_t *  reg,
unsigned int  depth 
) const [virtual]

returns the length of the longest key, subject to an optional regular expression and max depth

Reimplemented from plist::DictionaryBase.

Definition at line 275 of file plistSpecialty.h.

template<>
double plist::RGBColor< double >::getMax (  ) 

Definition at line 309 of file plistSpecialty.h.

template<>
float plist::RGBColor< float >::getMax (  ) 

Definition at line 308 of file plistSpecialty.h.

template<class T>
static T plist::RGBColor< T >::getMax (  )  [static, protected]
template<class T>
void plist::RGBColor< T >::init (  )  [protected]
template<class T >
void plist::RGBColor< T >::loadXML ( xmlNode node  )  [virtual]

This specialization looks for the SensorInfo::sensorType, then has the factory construct the correct subtype before loading the node into and returning that.

From the name of node, will instantiate a new ObjectBase subclass to load it.

supports use of plist::ArrayOf<PlannerObstacle> for polymorphic load/save

The mapping from node names to actual instantiated types is:

If successful, returns a pointer to a newly allocated region, which the caller is responsible for freeing. If an error occurs, NULL is returned.

attempts to load a new T instance from the specified xmlNode

Reimplemented from plist::DictionaryBase.

Definition at line 322 of file plistSpecialty.h.

template<class T>
static float plist::RGBColor< T >::makeFloat ( const T &  v  )  [static, protected]
template<class T>
static int plist::RGBColor< T >::makeInt ( const T &  v  )  [static, protected]

Definition at line 284 of file plistSpecialty.h.

Referenced by plist::RGBColor< T >::toString().

template<class T>
const plist::Primitive<T>& plist::RGBColor< T >::operator[] ( int  i  )  const

Definition at line 259 of file plistSpecialty.h.

template<class T>
plist::Primitive<T>& plist::RGBColor< T >::operator[] ( int  i  ) 

Definition at line 258 of file plistSpecialty.h.

template<class T>
ObjectBase* plist::RGBColor< T >::resolveEntry ( const std::string &  path  )  const [virtual]

returns a pointer to entry with the specified 'path', which may recurse through sub-collections

Reimplemented from plist::DictionaryBase.

Definition at line 271 of file plistSpecialty.h.

template<class T >
void plist::RGBColor< T >::saveXML ( xmlNode node  )  const [virtual]

subclasses are expected to provide a working implementation

Reimplemented from plist::DictionaryBase.

Definition at line 347 of file plistSpecialty.h.

template<class T >
void plist::RGBColor< T >::set ( const std::string &  str  )  [virtual]

Definition at line 374 of file plistSpecialty.h.

template<class T >
void plist::RGBColor< T >::set ( const plist::ObjectBase  )  [virtual]

polymorphic assignment (throws std::bad_cast if the assignment is between invalid types, i.e. a primitive and a collection, or different collection types)

Reimplemented from plist::DictionaryOf< plist::Primitive< T > >.

Definition at line 364 of file plistSpecialty.h.

template<class T >
void plist::RGBColor< T >::set ( const RGBColor< T > &  x  )  [virtual]

Definition at line 358 of file plistSpecialty.h.

Referenced by plist::RGBColor< T >::set().

template<>
void plist::RGBColor< unsigned char >::setNumeric ( plist::Primitive< unsigned char > &  n  ) 

Definition at line 320 of file plistSpecialty.h.

template<>
void plist::RGBColor< char >::setNumeric ( plist::Primitive< char > &  n  ) 

Definition at line 319 of file plistSpecialty.h.

template<class T>
static void plist::RGBColor< T >::setNumeric ( plist::Primitive< T > &   )  [static, protected]

Definition at line 288 of file plistSpecialty.h.

Referenced by plist::RGBColor< T >::init().

template<class T>
virtual size_t plist::RGBColor< T >::size (  )  const [virtual]

return the size of the dictionary

Reimplemented from plist::DictionaryBase.

Definition at line 263 of file plistSpecialty.h.

template<class T >
std::string plist::RGBColor< T >::toString (  )  const [virtual]

return current value as a string

Reimplemented from plist::DictionaryBase.

Definition at line 488 of file plistSpecialty.h.

Referenced by plist::RGBColor< T >::saveXML().


Member Data Documentation


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:25 2016 by Doxygen 1.6.3