Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_PropertyList::Array Class Reference

Inheritance diagram for CP_PropertyList::Array:

CP_PropertyList::Node CP_CFMutableObject< CFArrayRef, CFMutableArrayRef > CP_M_RefCounted CP_CFObject< CFArrayRef > List of all members.

Node overrides and implementation of abstract methods

virtual NodeType_t NodeType () const throw ()
static ArrayFromXMLData (CP_InStream &inXMLDataStream)

Public Types

typedef UInt32 size_type
typedef UInt32 difference_type
typedef Nodevalue_type
typedef const Nodeconst_reference
typedef _reference reference
typedef _iterator iterator
typedef _const_iterator const_iterator
typedef std::reverse_iterator<
iterator
reverse_iterator
typedef std::reverse_iterator<
const_iterator
const_reverse_iterator
enum  { npos = 0xffffffff }

Public Member Functions

 Array ()
 Array (const Array &inSrc)
 Array (const std::vector< const Node * > &inValues)
 Array (CFArrayRef inArrayRef, bool inRetain=true)
 Array (const std::vector< CFTypeRef > &inValues)
virtual ~Array () throw ()
ArrayMakeMutable () const
 Make a mutable array with the same contents.
virtual void PrintToLog (CP_LogFile &inLogFile, SInt32 inLevel=0, SInt32 inIndentLevel=0) const
virtual CFTypeRef GetNodeCFRef () const
virtual void WriteXMLData (CP_OutStream &inXMLDataStream) const
Getting / Setting values
const NodeGetValue (size_type inIndex) const
 Get the value at the specified position.
void SetValue (size_type inIndex, const Node &inValue)
 Set a value in the array.
void AppendValue (const Node &inValue)
 Append a value to the end of the array.
void DeleteValue (size_type inIndex)
 Delete a value from the array.
Convenience Getters/Setters
CP_String GetStringValue (size_type inIndex) const
 Get typed value.
UInt32 GetUInt32Value (size_type inIndex) const
SInt32 GetSInt32Value (size_type inIndex) const
double GetFloatValue (size_type inIndex) const
bool GetBooleanValue (size_type inIndex) const
CP_DateTime GetDateTimeValue (size_type inIndex) const
void GetDateTimeValue (size_type inIndex, CP_Date *outDate, CP_Time *outTime) const
CP_UUID GetUUIDValue (size_type inIndex) const
const ArrayGetArrayValue (size_type inIndex) const
const DictionaryGetDictionaryValue (size_type inIndex) const
void SetStringValue (size_type inIndex, const CP_String &inValue)
 Set a value in the array.
void SetNumberValue (size_type inIndex, UInt32 inValue)
void SetNumberValue (size_type inIndex, double inValue)
void SetBooleanValue (size_type inIndex, bool inValue)
void SetDateTimeValue (size_type inIndex, const CP_DateTime &inDateTime)
void SetDateTimeValue (size_type inIndex, const CP_Date &inDate)
void SetDateTimeValue (size_type inIndex, const CP_Time &inTime)
void SetUUIDValue (size_type inIndex, const CP_UUID &inUUID)
void AppendStringValue (const CP_String &inValue)
 Append a value to the end of the array.
void AppendNumberValue (UInt32 inValue)
void AppendNumberValue (double inValue)
void AppendBooleanValue (bool inValue)
void AppendDateTimeValue (const CP_DateTime &inDateTime)
void AppendDateTimeValue (const CP_Date &inDate)
void AppendDateTimeValue (const CP_Time &inTime)
void AppendUUIDValue (const CP_UUID &inUUID)
STL sequence container like interface
size_type size () const
void resize (size_type inNewSize)
bool empty () const
const Nodeoperator[] (size_type inIndex) const
reference operator[] (size_type inIndex)
const Nodefront () const
reference front ()
const Nodeback () const
reference back ()
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const

Static Public Member Functions

template<class _InputIterator, class _ValueConverter>
static ArrayArrayFromValues (_InputIterator begin, _InputIterator end, _ValueConverter converter=_identity< typename _InputIterator::value_type >())
template<class _InputIterator, class _ValueConverter>
static ArrayArrayFromCFObjects (_InputIterator begin, _InputIterator end, _ValueConverter converter=_identity< typename _InputIterator::value_type >())
static NodeFromXMLData (CP_InStream &inXMLDataStream, NodeType_t inExpectedNodeType=NodeType_Any)
static NodeCreateNodeForCFObject (CFTypeRef inObject)

Protected Member Functions

CFMutableArrayRef GetMutableCFRef ()
 operator TMutableCFRef ()
void AttachRefMutable (CFMutableArrayRefinMutableRef, bool inRetain)
void AttachRef (CFArrayRefinRef, bool inRetain)
CFMutableArrayRef DetachRefMutable ()
void MakeMutable ()
CFMutableArrayRef MutableCopy (CFArrayRefinCFRef)
CFArrayRef DetachRef ()
CFArrayRef GetCFRef () const
bool IsValid () const

Protected Attributes

CFArrayRef fCFObject

Classes

class  _const_iterator
struct  _identity
class  _iterator
class  _reference

Member Typedef Documentation

typedef UInt32 CP_PropertyList::Array::size_type
 

typedef UInt32 CP_PropertyList::Array::difference_type
 

typedef Node* CP_PropertyList::Array::value_type
 

typedef const Node* CP_PropertyList::Array::const_reference
 

typedef _reference CP_PropertyList::Array::reference
 

typedef _iterator CP_PropertyList::Array::iterator
 

typedef _const_iterator CP_PropertyList::Array::const_iterator
 

typedef std::reverse_iterator<iterator> CP_PropertyList::Array::reverse_iterator
 

typedef std::reverse_iterator<const_iterator> CP_PropertyList::Array::const_reverse_iterator
 


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
npos  specifies a position beyond the end of the array


Constructor & Destructor Documentation

CP_PropertyList::Array::Array  ) 
 

CP_PropertyList::Array::Array const Array inSrc  ) 
 

CP_PropertyList::Array::Array const std::vector< const Node * > &  inValues  )  [explicit]
 

CP_PropertyList::Array::Array CFArrayRef  inArrayRef,
bool  inRetain = true
[explicit]
 

CP_PropertyList::Array::Array const std::vector< CFTypeRef > &  inValues  )  [explicit]
 

CP_PropertyList::Array::~Array  )  throw () [virtual]
 


Member Function Documentation

template<class _InputIterator, class _ValueConverter>
static Array* CP_PropertyList::Array::ArrayFromValues _InputIterator  begin,
_InputIterator  end,
_ValueConverter  converter = _identity<typename _InputIterator::value_type>()
[static]
 

template<class _InputIterator, class _ValueConverter>
static Array* CP_PropertyList::Array::ArrayFromCFObjects _InputIterator  begin,
_InputIterator  end,
_ValueConverter  converter = _identity<typename _InputIterator::value_type>()
[static]
 

const Node * CP_PropertyList::Array::GetValue size_type  inIndex  )  const
 

Extracts the value at the specified index and returns the corresponding CP_PropertyList::Node instance.

Exceptions:
CP_BoundsException raised if index is not in the legal range [0..n[, where n is the array's element count
Parameters:
inIndex The index of the value to retrieve.
Returns:
An object representing the value at the specified index.

void CP_PropertyList::Array::SetValue size_type  inIndex,
const Node inValue
 

Sets a value in the array to the object specified by the inValue parameter.

Exceptions:
CP_BoundsException raised if index is not in the legal range [0..n], where n is the array's element count (or npos).
Parameters:
inIndex Index [0-based] of the value to set. Pass npos or the current element count to append the value.
inValue The value to set at the specified position.

void CP_PropertyList::Array::AppendValue const Node inValue  ) 
 

Appends the value specified in inValue to the end of the array.
Semantically equivalent to SetValue(Array::npos, inValue).

Parameters:
inValue The value to append.

void CP_PropertyList::Array::DeleteValue size_type  inIndex  ) 
 

Deletes the value at the index specified by inIndex from the array. Elements following the deleted element will be moved one position further to the front of the array.

Exceptions:
CP_BoundsException raised if index is not in the legal range [0..n[ where n is the array's element count.
Parameters:
inIndex The position of the element to delete.

CP_String CP_PropertyList::Array::GetStringValue size_type  inIndex  )  const
 

Extracts the value at the specified index and returns as a native C++ type.

Exceptions:
CP_BoundsException raised if index is not in the legal range [0..n[, where n is the array's element count
std::bad_cast raised if value is not of the expected class.
Parameters:
inIndex The index of the value to retrieve.
Returns:
The value at the specified index.

UInt32 CP_PropertyList::Array::GetUInt32Value size_type  inIndex  )  const
 

SInt32 CP_PropertyList::Array::GetSInt32Value size_type  inIndex  )  const
 

double CP_PropertyList::Array::GetFloatValue size_type  inIndex  )  const
 

bool CP_PropertyList::Array::GetBooleanValue size_type  inIndex  )  const
 

CP_DateTime CP_PropertyList::Array::GetDateTimeValue size_type  inIndex  )  const
 

void CP_PropertyList::Array::GetDateTimeValue size_type  inIndex,
CP_Date outDate,
CP_Time outTime
const
 

CP_UUID CP_PropertyList::Array::GetUUIDValue size_type  inIndex  )  const
 

const Array * CP_PropertyList::Array::GetArrayValue size_type  inIndex  )  const
 

const Dictionary * CP_PropertyList::Array::GetDictionaryValue size_type  inIndex  )  const
 

void CP_PropertyList::Array::SetStringValue size_type  inIndex,
const CP_String inValue
 

Sets a value in the array to the data specified by the inValue parameter.

Exceptions:
CP_BoundsException raised if index is not in the legal range [0..n] where n is the array's element count.
Parameters:
inIndex Index [0-based] of the value to set. Pass npos or the current element count to append the value.
inValue The value to set at the specified position.

void CP_PropertyList::Array::SetNumberValue size_type  inIndex,
UInt32  inValue
 

void CP_PropertyList::Array::SetNumberValue size_type  inIndex,
double  inValue
 

void CP_PropertyList::Array::SetBooleanValue size_type  inIndex,
bool  inValue
 

void CP_PropertyList::Array::SetDateTimeValue size_type  inIndex,
const CP_DateTime inDateTime
 

void CP_PropertyList::Array::SetDateTimeValue size_type  inIndex,
const CP_Date inDate
 

void CP_PropertyList::Array::SetDateTimeValue size_type  inIndex,
const CP_Time inTime
 

void CP_PropertyList::Array::SetUUIDValue size_type  inIndex,
const CP_UUID inUUID
 

void CP_PropertyList::Array::AppendStringValue const CP_String inValue  ) 
 

Appends the value specified in inValue to the end of the array.
Semantically equivalent to SetValue(Array::npos, inValue).

Parameters:
inValue The value to append.

void CP_PropertyList::Array::AppendNumberValue UInt32  inValue  ) 
 

void CP_PropertyList::Array::AppendNumberValue double  inValue  ) 
 

void CP_PropertyList::Array::AppendBooleanValue bool  inValue  ) 
 

void CP_PropertyList::Array::AppendDateTimeValue const CP_DateTime inDateTime  ) 
 

void CP_PropertyList::Array::AppendDateTimeValue const CP_Date inDate  ) 
 

void CP_PropertyList::Array::AppendDateTimeValue const CP_Time inTime  ) 
 

void CP_PropertyList::Array::AppendUUIDValue const CP_UUID inUUID  ) 
 

Array * CP_PropertyList::Array::MakeMutable  )  const
 

Returns a mutable array with the same contents as this array. It's up to the implementation to implement some copy-on-write mechanism, so in general, you shouldn neiter assume to get back the same object, nor assume it's a new object...
In any event, you don't need to release the object you get. If you want to hold on to the object for longer, you'll have to retain it (see CP_M_RefCounted::AddReference), otherwise it may go away at autorelease pool release time.

Exceptions:
none 
Returns:
A mutable array with the same contents as this array.

Array::size_type CP_PropertyList::Array::size  )  const
 

void CP_PropertyList::Array::resize size_type  inNewSize  ) 
 

bool CP_PropertyList::Array::empty  )  const
 

const Node * CP_PropertyList::Array::operator[] size_type  inIndex  )  const
 

Array::reference CP_PropertyList::Array::operator[] size_type  inIndex  ) 
 

const Node * CP_PropertyList::Array::front  )  const
 

Array::reference CP_PropertyList::Array::front  ) 
 

const Node * CP_PropertyList::Array::back  )  const
 

Array::reference CP_PropertyList::Array::back  ) 
 

Array::iterator CP_PropertyList::Array::begin  ) 
 

Array::iterator CP_PropertyList::Array::end  ) 
 

Array::const_iterator CP_PropertyList::Array::begin  )  const
 

Array::const_iterator CP_PropertyList::Array::end  )  const
 

Array::reverse_iterator CP_PropertyList::Array::rbegin  ) 
 

Array::reverse_iterator CP_PropertyList::Array::rend  ) 
 

Array::const_reverse_iterator CP_PropertyList::Array::rbegin  )  const
 

Array::const_reverse_iterator CP_PropertyList::Array::rend  )  const
 

NodeType_t CP_PropertyList::Array::NodeType  )  const throw () [virtual]
 

Implements CP_PropertyList::Node.

Array * CP_PropertyList::Array::FromXMLData CP_InStream inXMLDataStream  )  [static]
 

void CP_PropertyList::Array::PrintToLog CP_LogFile inLogFile,
SInt32  inLevel = 0,
SInt32  inIndentLevel = 0
const [virtual]
 

Implements CP_PropertyList::Node.

virtual CFTypeRef CP_PropertyList::Array::GetNodeCFRef  )  const [virtual]
 

Implements CP_PropertyList::Node.

void CP_PropertyList::Node::WriteXMLData CP_OutStream inXMLDataStream  )  const [virtual, inherited]
 

Node * CP_PropertyList::Node::FromXMLData CP_InStream inXMLDataStream,
NodeType_t  inExpectedNodeType = NodeType_Any
[static, inherited]
 

static Node* CP_PropertyList::Node::CreateNodeForCFObject CFTypeRef  inObject  )  [static, inherited]
 

UInt32 CP_M_RefCounted::AddReference  )  const [inherited]
 

Add a reference to our object, returning the new reference count.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

UInt32 CP_M_RefCounted::RemoveReference  )  const [inherited]
 

Remove a reference to our object, returning the new reference count. If the count is 0, then this object is also deleted, and 0 is returned.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

void CP_M_RefCounted::Autorelease  )  const [inherited]
 

Add the object to the topmost auto-release pool. This will ensure that the object is eventually released.

See also:
CP_AutoReleasePool
Exceptions:
none 
Returns:
void

UInt32 CP_M_RefCounted::GetRefCount  )  const [inherited]
 

Returns the current ref count.

Exceptions:
none 
Returns:
UInt32 The current referencce count.

CFMutableArrayRef CP_CFMutableObject< CFArrayRef , CFMutableArrayRef >::GetMutableCFRef  )  [inherited]
 

Returns a mutable CFRef for this object. If the object is not mutable already, then it is first made mutable before returning the CFRef.

Exceptions:
none 

CP_CFMutableObject< CFArrayRef , CFMutableArrayRef >::operator CFMutableArrayRef  )  [inherited]
 

operator TMutableCFRef to return the mutable CFRef object for this class.

Exceptions:
none 
Returns:
CFMutableCFRef The mutable CFRef object for ths class.

void CP_CFMutableObject< CFArrayRef , CFMutableArrayRef >::AttachRefMutable CFMutableArrayRef   inMutableRef,
bool  inRetain
[inherited]
 

Attach a reference to the passed in CFRef.

Parameters:
inMutableRef The mutable ref object to attach the reference to.
inRetain Flag to indicate if we retain this object.
Exceptions:
none 

void CP_CFMutableObject< CFArrayRef , CFMutableArrayRef >::AttachRef CFArrayRef   inRef,
bool  inRetain
[inherited]
 

Attach a reference to the passed in CFRef.

Parameters:
refToAttach The object to attach the reference to.
inRetain Flag to indicate if we retain this object.
Exceptions:
none 

Reimplemented from CP_CFObject< CFArrayRef >.

CFMutableArrayRef CP_CFMutableObject< CFArrayRef , CFMutableArrayRef >::DetachRefMutable  )  [inherited]
 

Detach a reference to the CFRef maintained by this object. If the object is not mutable, it is first made mutable.

Exceptions:
none 

void CP_CFMutableObject< CFArrayRef , CFMutableArrayRef >::MakeMutable  )  [protected, inherited]
 

Turns this object we are storing into a mutable version.

Exceptions:
none 

CFMutableArrayRef CP_CFMutableObject< CFArrayRef , CFMutableArrayRef >::MutableCopy CFArrayRef   inCFRef  )  [protected, inherited]
 

CFArrayRef CP_CFObject< CFArrayRef >::DetachRef  )  [inherited]
 

CFArrayRef CP_CFObject< CFArrayRef >::GetCFRef  )  const [inherited]
 

bool CP_CFObject< CFArrayRef >::IsValid  )  const [inherited]
 


Member Data Documentation

CFArrayRef CP_CFObject< CFArrayRef >::fCFObject [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:02:37 2005 for CPLAT by  doxygen 1.4.0