#include <Array.hh>
Inheritance diagram for pdf::core::CArray:
the PDF array object contains a list of PDF objects. according to the PDF specs, each object in the same array can be of different type. as a result, the only avaliable implementation in code is to store a list of CObject pointers, which points to different derived classes of CObjects.
the array object owns all the contained CObject pointers. it will destroy them in its destructor.
|
short cut
|
|
default constructor create an empty array
00039 { 00040 } |
|
the copy constructor will deep copy all object in the array.
00054 { 00055 for ( iterator i = array.begin( ) ; i != array.end( ) ; ++i ) 00056 push_back( i->Dup( ) ) ; 00057 } |
|
create an array with only one element
00045 : m_objects( 1, boost::shared_ptr<CObject>( object ) ) 00046 { 00047 } |
|
destructor do nothing. vector and shared_ptr's destructor will do the job nicely.
00063 { 00064 } |
|
this function will take a range of int/long/double/string and make an array of PDF objects out of them. the mapping from int/long/double to CNumber and string to CName is stored in the CType2PDF template.
|
|
this function will add an object to the end of the array. note that the pointer is owned by the array.
00073 { 00074 m_objects.push_back( boost::shared_ptr<CObject>( object ) ) ; 00075 } |
|
return an iterator to point to the first CObject in the array. the iterator returns a constant reference to the contained CObject.
00083 { 00084 return iterator( m_objects.begin( ) ) ; 00085 } |
|
return an iterator to point to the pass-the-end CObject in the array. the iterator returns a constant reference to the contained CObject.
00093 { 00094 return iterator( m_objects.end( ) ) ; 00095 } |
|
return the number of CObject objects in the array.
00102 { 00103 return m_objects.size( ) ; 00104 } |
|
return true if there is no objects in the array, otherwise false.
00111 { 00112 return m_objects.empty( ) ; 00113 } |
|
write the array to the output stream, which should be a PDF file. it will put a pair of square backets around the contained objects. Implements pdf::core::CObject.
|
|
dynamic clone. call the real copy constructor. note that the copy constructor will deep copy the contained objects. Implements pdf::core::CObject.
00131 { 00132 return new CArray( *this ) ; 00133 } |
|
the list of CObject pointers
|