MADARA  3.1.8
madara::knowledge::rcw::Tracked< std::vector< T > > Class Template Reference

Implement functionality specific to std::vectors. More...

#include <Tracked.h>

Inheritance diagram for madara::knowledge::rcw::Tracked< std::vector< T > >:
Collaboration diagram for madara::knowledge::rcw::Tracked< std::vector< T > >:

Public Types

typedef std::vector< T >::const_iterator const_iterator
 
typedef std::vector< T >::value_type value_type
 

Public Member Functions

 Tracked ()
 Default constructor, with empty vector. More...
 
 Tracked (std::vector< T > val)
 Construct from an existing vector. More...
 
const value_typeat (size_t i) const
 Pass through at method to underlying collection. More...
 
value_typeat_mut (size_t i)
 Pass through to non-const version of at method of underlying collection Immediately mark that index as modified when called. More...
 
value_typeat_mutable (size_t i)
 Synonym for. More...
 
const value_typeback () const
 Equivalent to back method of underlying collection. More...
 
value_typeback ()
 Equivalent to non-const back method of underlying collection. More...
 
const_iterator begin () const
 Pass through to const begin method of underlying collection. More...
 
size_t capacity () const
 Pass through capacity method to underlying vector. More...
 
const_iterator cbegin () const
 Pass through to cbegin method of underlying collection. More...
 
const_iterator cend () const
 Pass through to cend method of underlying collection. More...
 
void clear ()
 Pass through clear method to underlying vector. More...
 
void clear_dirty ()
 Clear all modification tracking. More...
 
void clear_dirty (size_t i)
 Clear i-th element modification status. More...
 
bool empty ()
 Pass through to empty method of underlying collection. More...
 
const_iterator end () const
 Pass through to const end method of underlying collection. More...
 
const value_typefront () const
 Equivalent to front method of underlying collection. More...
 
value_typefront_mut ()
 Equivalent to non-const front method of underlying collection. More...
 
const value_typeget (size_t i) const
 Synonym for. More...
 
const std::vector< T > & get () const
 Get const reference to underlying vector. More...
 
value_typeget_mut (size_t i)
 Synonym for. More...
 
std::vector< T > & get_mut ()
 Get non-const reference to underlying vector; mark all elements as dirty immediately. More...
 
value_typeget_mutable (size_t i)
 Synonym for. More...
 
std::vector< T > & get_mutable ()
 Get non-const reference to underlying vector; mark all elements as dirty immediately. More...
 
bool is_all_dirty () const
 Has entire vector been marked as modified? Note that this will still return false if every entry has been marked modified individually. More...
 
bool is_dirty () const
 Has anything about this vector changed? More...
 
bool is_dirty (size_t i) const
 Check i-th element modification status. More...
 
bool is_size_dirty () const
 Has the size of this vector changed? More...
 
size_t max_size ()
 Pass through to max_size method of underlying collection. More...
 
void modify ()
 Flag entire vector as modified. More...
 
void modify (size_t i)
 Mark i-th element as modified. More...
 
const std::vector< T > & operator* () const
 Dereference to const reference. More...
 
const std::vector< T > * operator-> () const
 Use to call const methods on underlying vector. More...
 
Trackedoperator= (const std::vector< T > &val)
 Set entire vector to new vector. More...
 
const value_typeoperator[] (size_t i) const
 Pass through operator[] to underlying collection. More...
 
void pop_back ()
 Pass through pop_back method to underlying vector. More...
 
void push_back (const value_type &value)
 Pass through push_back method to underlying vector. More...
 
void reserve (size_t count)
 Pass through reserve method to underlying vector. More...
 
void resize (size_t count)
 Pass through resize method to underlying vector. More...
 
void set (size_t i, value_type val)
 Set value at index . More...
 
void set (const std::vector< T > &val)
 Set entire vector to new vector. More...
 
size_t size ()
 Pass through to size method of underlying collection. More...
 

Private Types

typedef TrackedCollection< Vec, Tracked< std::vector< T > > > Base
 
typedef std::vector< T > Vec
 

Static Private Member Functions

static std::pair< size_t, uint64_t > to_dirty_bit (size_t i)
 Get dirty flag bit offset into dirty_ vector, plus mask. More...
 
static size_t to_dirty_size (size_t i)
 Get size of dirty_ vector needed to fit i-th dirty bit. More...
 

Private Attributes

bool all_dirty_
 dirty status to treat entire vector as modified More...
 
std::vector< uint64_t > dirty_
 dirty status for each entry More...
 
bool size_dirty_
 dirty status for size of vector More...
 
Vec val_
 the vector we're wrapping More...
 

Friends

bool operator!= (const Tracked &lhs, const Tracked &rhs)
 
bool operator< (const Tracked &lhs, const Tracked &rhs)
 
bool operator<= (const Tracked &lhs, const Tracked &rhs)
 
bool operator== (const Tracked &lhs, const Tracked &rhs)
 
bool operator> (const Tracked &lhs, const Tracked &rhs)
 
bool operator>= (const Tracked &lhs, const Tracked &rhs)
 
void swap (Tracked &lhs, Tracked &rhs)
 Implement swap for tracked vectors. More...
 
class TrackedCollection< std::vector< T >, Tracked< std::vector< T > > >
 

Detailed Description

template<typename T>
class madara::knowledge::rcw::Tracked< std::vector< T > >

Implement functionality specific to std::vectors.

Definition at line 588 of file Tracked.h.

Member Typedef Documentation

template<typename T >
typedef TrackedCollection<Vec, Tracked<std::vector<T> > > madara::knowledge::rcw::Tracked< std::vector< T > >::Base
private

Definition at line 592 of file Tracked.h.

template<typename T >
typedef std::vector<T>::const_iterator madara::knowledge::rcw::Tracked< std::vector< T > >::const_iterator

Definition at line 624 of file Tracked.h.

template<typename T >
typedef std::vector<T>::value_type madara::knowledge::rcw::Tracked< std::vector< T > >::value_type

Definition at line 623 of file Tracked.h.

template<typename T >
typedef std::vector<T> madara::knowledge::rcw::Tracked< std::vector< T > >::Vec
private

Definition at line 591 of file Tracked.h.

Constructor & Destructor Documentation

template<typename T >
madara::knowledge::rcw::Tracked< std::vector< T > >::Tracked ( )
inline

Default constructor, with empty vector.

Definition at line 627 of file Tracked.h.

template<typename T >
madara::knowledge::rcw::Tracked< std::vector< T > >::Tracked ( std::vector< T >  val)
inlineexplicit

Construct from an existing vector.

Definition at line 629 of file Tracked.h.

Member Function Documentation

const value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::at ( size_t  i) const
inlineinherited

Pass through at method to underlying collection.

Definition at line 352 of file Tracked.h.

value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::at_mut ( size_t  i)
inlineinherited

Pass through to non-const version of at method of underlying collection Immediately mark that index as modified when called.

Definition at line 371 of file Tracked.h.

value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::at_mutable ( size_t  i)
inlineinherited

Synonym for.

See also
at_mut

Definition at line 378 of file Tracked.h.

const value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::back ( void  ) const
inlineinherited

Equivalent to back method of underlying collection.

Definition at line 409 of file Tracked.h.

value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::back ( void  )
inlineinherited

Equivalent to non-const back method of underlying collection.

Definition at line 420 of file Tracked.h.

const_iterator madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::begin ( void  ) const
inlineinherited

Pass through to const begin method of underlying collection.

Definition at line 426 of file Tracked.h.

template<typename T >
size_t madara::knowledge::rcw::Tracked< std::vector< T > >::capacity ( ) const
inline

Pass through capacity method to underlying vector.

Definition at line 758 of file Tracked.h.

const_iterator madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::cbegin ( ) const
inlineinherited

Pass through to cbegin method of underlying collection.

Definition at line 432 of file Tracked.h.

const_iterator madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::cend ( ) const
inlineinherited

Pass through to cend method of underlying collection.

Definition at line 444 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::clear ( void  )
inline

Pass through clear method to underlying vector.

Definition at line 790 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::clear_dirty ( )
inline

Clear all modification tracking.

Definition at line 716 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::clear_dirty ( size_t  i)
inline

Clear i-th element modification status.

Definition at line 733 of file Tracked.h.

bool madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::empty ( )
inlineinherited

Pass through to empty method of underlying collection.

Definition at line 398 of file Tracked.h.

const_iterator madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::end ( void  ) const
inlineinherited

Pass through to const end method of underlying collection.

Definition at line 438 of file Tracked.h.

const value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::front ( void  ) const
inlineinherited

Equivalent to front method of underlying collection.

Definition at line 403 of file Tracked.h.

value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::front_mut ( )
inlineinherited

Equivalent to non-const front method of underlying collection.

Definition at line 415 of file Tracked.h.

const value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::get ( size_t  i) const
inlineinherited

Synonym for.

See also
at

Definition at line 364 of file Tracked.h.

template<typename T >
const std::vector<T>& madara::knowledge::rcw::Tracked< std::vector< T > >::get ( ) const
inline

Get const reference to underlying vector.

Definition at line 634 of file Tracked.h.

value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::get_mut ( size_t  i)
inlineinherited

Synonym for.

See also
at_mut

Definition at line 384 of file Tracked.h.

template<typename T >
std::vector<T>& madara::knowledge::rcw::Tracked< std::vector< T > >::get_mut ( )
inline

Get non-const reference to underlying vector; mark all elements as dirty immediately.

Usually, you should use the get_mut(index) version

Definition at line 641 of file Tracked.h.

value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::get_mutable ( size_t  i)
inlineinherited

Synonym for.

See also
at_mut

Definition at line 390 of file Tracked.h.

template<typename T >
std::vector<T>& madara::knowledge::rcw::Tracked< std::vector< T > >::get_mutable ( )
inline

Get non-const reference to underlying vector; mark all elements as dirty immediately.

Usually, you should use the get_mut(index) version Synonym for get_mut

Definition at line 650 of file Tracked.h.

template<typename T >
bool madara::knowledge::rcw::Tracked< std::vector< T > >::is_all_dirty ( ) const
inline

Has entire vector been marked as modified? Note that this will still return false if every entry has been marked modified individually.

This only returns true if modified(), get_mut(), or set(std::vector) has been called.

Definition at line 693 of file Tracked.h.

template<typename T >
bool madara::knowledge::rcw::Tracked< std::vector< T > >::is_dirty ( ) const
inline

Has anything about this vector changed?

Definition at line 705 of file Tracked.h.

template<typename T >
bool madara::knowledge::rcw::Tracked< std::vector< T > >::is_dirty ( size_t  i) const
inline

Check i-th element modification status.

Definition at line 741 of file Tracked.h.

template<typename T >
bool madara::knowledge::rcw::Tracked< std::vector< T > >::is_size_dirty ( ) const
inline

Has the size of this vector changed?

Definition at line 699 of file Tracked.h.

size_t madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::max_size ( void  )
inlineinherited

Pass through to max_size method of underlying collection.

Definition at line 400 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::modify ( void  )
inline

Flag entire vector as modified.

Definition at line 684 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::modify ( size_t  i)
inline

Mark i-th element as modified.

Definition at line 725 of file Tracked.h.

template<typename T >
const std::vector<T>& madara::knowledge::rcw::Tracked< std::vector< T > >::operator* ( void  ) const
inline

Dereference to const reference.

Definition at line 657 of file Tracked.h.

template<typename T >
const std::vector<T>* madara::knowledge::rcw::Tracked< std::vector< T > >::operator-> ( ) const
inline

Use to call const methods on underlying vector.

Definition at line 663 of file Tracked.h.

template<typename T >
Tracked& madara::knowledge::rcw::Tracked< std::vector< T > >::operator= ( const std::vector< T > &  val)
inline

Set entire vector to new vector.

Definition at line 677 of file Tracked.h.

const value_type& madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::operator[] ( size_t  i) const
inlineinherited

Pass through operator[] to underlying collection.

Definition at line 358 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::pop_back ( )
inline

Pass through pop_back method to underlying vector.

Definition at line 782 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::push_back ( const value_type value)
inline

Pass through push_back method to underlying vector.

Definition at line 773 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::reserve ( size_t  count)
inline

Pass through reserve method to underlying vector.

Definition at line 766 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::resize ( size_t  count)
inline

Pass through resize method to underlying vector.

Definition at line 750 of file Tracked.h.

void madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::set ( size_t  i,
value_type  val 
)
inlineinherited

Set value at index .

Parameters
iindex to set
valvalue to set to

Definition at line 345 of file Tracked.h.

template<typename T >
void madara::knowledge::rcw::Tracked< std::vector< T > >::set ( const std::vector< T > &  val)
inline

Set entire vector to new vector.

Definition at line 669 of file Tracked.h.

size_t madara::knowledge::rcw::TrackedCollection< std::vector< T > , Tracked< std::vector< T > > >::size ( void  )
inlineinherited

Pass through to size method of underlying collection.

Definition at line 396 of file Tracked.h.

template<typename T >
static std::pair<size_t, uint64_t> madara::knowledge::rcw::Tracked< std::vector< T > >::to_dirty_bit ( size_t  i)
inlinestaticprivate

Get dirty flag bit offset into dirty_ vector, plus mask.

Definition at line 607 of file Tracked.h.

template<typename T >
static size_t madara::knowledge::rcw::Tracked< std::vector< T > >::to_dirty_size ( size_t  i)
inlinestaticprivate

Get size of dirty_ vector needed to fit i-th dirty bit.

Definition at line 615 of file Tracked.h.

Friends And Related Function Documentation

template<typename T >
bool operator!= ( const Tracked< std::vector< T > > &  lhs,
const Tracked< std::vector< T > > &  rhs 
)
friend

Definition at line 803 of file Tracked.h.

template<typename T >
bool operator< ( const Tracked< std::vector< T > > &  lhs,
const Tracked< std::vector< T > > &  rhs 
)
friend

Definition at line 806 of file Tracked.h.

template<typename T >
bool operator<= ( const Tracked< std::vector< T > > &  lhs,
const Tracked< std::vector< T > > &  rhs 
)
friend

Definition at line 804 of file Tracked.h.

template<typename T >
bool operator== ( const Tracked< std::vector< T > > &  lhs,
const Tracked< std::vector< T > > &  rhs 
)
friend

Definition at line 802 of file Tracked.h.

template<typename T >
bool operator> ( const Tracked< std::vector< T > > &  lhs,
const Tracked< std::vector< T > > &  rhs 
)
friend

Definition at line 807 of file Tracked.h.

template<typename T >
bool operator>= ( const Tracked< std::vector< T > > &  lhs,
const Tracked< std::vector< T > > &  rhs 
)
friend

Definition at line 805 of file Tracked.h.

template<typename T >
void swap ( Tracked< std::vector< T > > &  lhs,
Tracked< std::vector< T > > &  rhs 
)
friend

Implement swap for tracked vectors.

Definition at line 810 of file Tracked.h.

template<typename T >
friend class TrackedCollection< std::vector< T >, Tracked< std::vector< T > > >
friend

Definition at line 620 of file Tracked.h.

Member Data Documentation

template<typename T >
bool madara::knowledge::rcw::Tracked< std::vector< T > >::all_dirty_
private

dirty status to treat entire vector as modified

Definition at line 601 of file Tracked.h.

template<typename T >
std::vector<uint64_t> madara::knowledge::rcw::Tracked< std::vector< T > >::dirty_
private

dirty status for each entry

Definition at line 598 of file Tracked.h.

template<typename T >
bool madara::knowledge::rcw::Tracked< std::vector< T > >::size_dirty_
private

dirty status for size of vector

Definition at line 604 of file Tracked.h.

template<typename T >
Vec madara::knowledge::rcw::Tracked< std::vector< T > >::val_
private

the vector we're wrapping

Definition at line 595 of file Tracked.h.


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