PPL Logo

CkSequence< T > Class Template Reference

Data Structure to store a sequence of any type, typically int, short, long etc. More...

#include <cksequence.h>

Collaboration diagram for CkSequence< T >:

Collaboration graph
[legend]

Public Types

typedef CkSequenceIterator< T > iterator

Public Member Functions

 CkSequence ()
 Creates a RandomSequence by default.
template<typename GenericIterator>
 CkSequence (const GenericIterator begin, const GenericIterator end)
 Creates Sequence object based on the vector passed in.
template<typename GenericIterator>
void Insert (const GenericIterator begin, const GenericIterator end)
 ~CkSequence ()
void Insert (const T &element)
 Inserts the element in to the CkSequence Data Structure.
void InsertIntoStrided (typename std::list< CkSequenceInternal< T > * >::iterator iter, const T &element)
void Remove (const T &element)
 Removes the element from the CkSequence Data Structure.
void DoneInserting ()
 Called when the elements have been inserted into the sequence and no further modification would happen.
int num_elements () const
 Identifies if the sequence has a stride pattern and if so returns true and sets stride to the identified stride.
int mem_size () const
iterator begin ()
 Returns the begin of the CkSequence.
iterator end ()
 Returns the end of the CkSequence Sample Usage: CkSequence<int>::iterator it = s.end();.
void pup (PUP::er &p)

Private Member Functions

void Compact ()

Private Attributes

min_
max_
num_elements_
bool compact_
char * bit_vector_
std::list< CkSequenceInternal
< T > * > 
subsequence_list_

Detailed Description

template<typename T>
class CkSequence< T >

Data Structure to store a sequence of any type, typically int, short, long etc.

Two types of CkSequences are currently supported, RANDOM and STRIDE. By default, a RandomCkSequence is created. This class Delegates the calls to the internal implementation of CkSequence

Sample Usage: CkSequence<int> s_default; CkSequence<int> seq_random(CkSequence<int>::RANDOM);

Template Parameters:
T 

Definition at line 120 of file cksequence.h.


Member Typedef Documentation

template<typename T>
typedef CkSequenceIterator<T> CkSequence< T >::iterator

Definition at line 245 of file cksequence.h.


Constructor & Destructor Documentation

template<typename T>
CkSequence< T >::CkSequence (  )  [inline]

Creates a RandomSequence by default.

Definition at line 128 of file cksequence.h.

template<typename T>
template<typename GenericIterator>
CkSequence< T >::CkSequence ( const GenericIterator  begin,
const GenericIterator  end 
) [inline]

Creates Sequence object based on the vector passed in.

The default sequence created is RandomSequence.

l containing the elements to be stored

Definition at line 137 of file cksequence.h.

References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, malloc(), CkSequence< T >::max_, CkSequence< T >::min_, and CkSequence< T >::num_elements_.

Here is the call graph for this function:

template<typename T>
CkSequence< T >::~CkSequence (  )  [inline]


Member Function Documentation

template<typename T>
template<typename GenericIterator>
void CkSequence< T >::Insert ( const GenericIterator  begin,
const GenericIterator  end 
) [inline]

Definition at line 168 of file cksequence.h.

References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, malloc(), CkSequence< T >::max_, CkSequence< T >::min_, and CkSequence< T >::num_elements_.

Here is the call graph for this function:

template<class T>
void CkSequence< T >::Insert ( const T &  element  )  [inline]

Inserts the element in to the CkSequence Data Structure.

element to be inserted

Definition at line 336 of file cksequence.h.

References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, CkSequence< T >::max_, CkSequence< T >::min_, and realloc().

Here is the call graph for this function:

template<typename T>
void CkSequence< T >::InsertIntoStrided ( typename std::list< CkSequenceInternal< T > * >::iterator  iter,
const T &  element 
)

template<class T>
void CkSequence< T >::Remove ( const T &  element  )  [inline]

Removes the element from the CkSequence Data Structure.

element to be removed

Definition at line 356 of file cksequence.h.

References CkSequence< T >::bit_vector_, and CkSequence< T >::compact_.

template<class T>
void CkSequence< T >::DoneInserting (  )  [inline]

Called when the elements have been inserted into the sequence and no further modification would happen.

Definition at line 460 of file cksequence.h.

References CkSequence< T >::Compact().

Here is the call graph for this function:

template<class T>
int CkSequence< T >::num_elements (  )  const [inline]

Identifies if the sequence has a stride pattern and if so returns true and sets stride to the identified stride.

stride sets it to be the stride for the given sequence

true if there is a stride pattern else false

Definition at line 364 of file cksequence.h.

References CkSequence< T >::subsequence_list_.

template<class T>
int CkSequence< T >::mem_size (  )  const [inline]

Definition at line 372 of file cksequence.h.

References CkSequence< T >::subsequence_list_.

template<typename T>
iterator CkSequence< T >::begin ( void   )  [inline]

Returns the begin of the CkSequence.

Sample Usage: CkSequence<int>::iterator it = s.begin();

the iterator pointing to the begin

Definition at line 254 of file cksequence.h.

References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, CkSequence< T >::max_, CkSequence< T >::min_, and CkSequence< T >::subsequence_list_.

template<typename T>
iterator CkSequence< T >::end ( void   )  [inline]

Returns the end of the CkSequence Sample Usage: CkSequence<int>::iterator it = s.end();.

the iterator to the end

Definition at line 269 of file cksequence.h.

References CkSequence< T >::bit_vector_, CkSequence< T >::compact_, and CkSequence< T >::max_.

template<typename T>
void CkSequence< T >::pup ( PUP::er p  )  [inline]

template<typename T>
void CkSequence< T >::Compact (  )  [inline, private]


Field Documentation

template<typename T>
T CkSequence< T >::min_ [private]

template<typename T>
T CkSequence< T >::max_ [private]

template<typename T>
T CkSequence< T >::num_elements_ [private]

template<typename T>
bool CkSequence< T >::compact_ [private]

template<typename T>
char* CkSequence< T >::bit_vector_ [private]

template<typename T>
std::list<CkSequenceInternal<T>*> CkSequence< T >::subsequence_list_ [private]


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

Generated on Mon Sep 21 08:21:36 2020 for Charm++ by  doxygen 1.5.5