Class xlifepp::PCollection#

template<typename T>
class PCollection : public std::vector<T*>#

Inheritence diagram for xlifepp::PCollection:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="std::vector< T >" tooltip="std::vector< T >"] "2" [label="std::vector< T * >" tooltip="std::vector< T * >"] "1" [label="xlifepp::PCollection< T >" tooltip="xlifepp::PCollection< T >" fillcolor="#BFBFBF"] "2" -> "3" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::PCollection:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="std::vector< T >" tooltip="std::vector< T >"] "2" [label="std::vector< T * >" tooltip="std::vector< T * >"] "1" [label="xlifepp::PCollection< T >" tooltip="xlifepp::PCollection< T >" fillcolor="#BFBFBF"] "2" -> "3" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

a simple interface to std::vector<T*> hide pointers, add the insertion operator <<, the constructors from enumerating items and access to items using operator ()

Be cautious when using it because pointers are shared (no copy). For instance, if you plan to create a list of T with a loop, do the following

PCollection<T> ts(10); for(int i=0;i<10;++i) ts[i] = new T(…); and clear the T pointers using: ts.clearPointers();

to access to item as const reference you can use either ts(i+1) (same as *ts[i])

Public Functions

inline PCollection(const std::initializer_list<T*> &ts)#

constructor from std::initializer_list<T*>

inline PCollection(const std::vector<T*> &ts)#

constructor from std::vector<T*>

inline PCollection(const T &t1)#

constructor from 1 T objects

inline PCollection(const T &t1, const T &t2)#

constructor from 2 T objects

inline PCollection(const T &t1, const T &t2, const T &t3)#

constructor from 3 T objects

inline PCollection(const T &t1, const T &t2, const T &t3, const T &t4)#

constructor from 4 T objects

inline PCollection(const T &t1, const T &t2, const T &t3, const T &t4, const T &t5)#

constructor from 5 T objects

inline PCollection(const T &t1, const T &t2, const T &t3, const T &t4, const T &t5, const T &t6)#

constructor from 6 T objects

inline PCollection(const T &t1, const T &t2, const T &t3, const T &t4, const T &t5, const T &t6, const T &t7)#

constructor from 7 T objects

inline PCollection(const T &t1, const T &t2, const T &t3, const T &t4, const T &t5, const T &t6, const T &t7, const T &t8)#

constructor from 8 T objects

inline PCollection(const T &t1, const T &t2, const T &t3, const T &t4, const T &t5, const T &t6, const T &t7, const T &t8, const T &t9)#

constructor from 9 T objects

inline PCollection(const T &t1, const T &t2, const T &t3, const T &t4, const T &t5, const T &t6, const T &t7, const T &t8, const T &t9, const T &t10)#

constructor from 10 T objects

inline explicit PCollection(number_t n = 0)#

constructor from size

inline PCollectionItem<T> operator()(number_t n)#

access to n-th number (non const)

inline const T &operator()(number_t n) const#

access to n-th number (const)

inline void print(PrintStream &os) const#

print utility

inline void print(std::ostream &out) const#

print utility