Fast DDS  Version 3.0.1
Fast DDS
Loading...
Searching...
No Matches
History Class Referenceabstract

Class History, container of the different CacheChanges and the methods to access them. More...

#include <History.hpp>

Inheritance diagram for History:

Public Types

using iterator = std::vector< CacheChange_t * >::iterator
 
using reverse_iterator = std::vector< CacheChange_t * >::reverse_iterator
 
using const_iterator = std::vector< CacheChange_t * >::const_iterator
 

Public Member Functions

FASTDDS_EXPORTED_API bool isFull ()
 Check if the history is full.
 
FASTDDS_EXPORTED_API size_t getHistorySize ()
 Get the History size.
 
FASTDDS_EXPORTED_API const_iterator find_change_nts (CacheChange_t *ch)
 Find a specific change in the history using the matches_change method criteria.
 
virtual FASTDDS_EXPORTED_API iterator remove_change_nts (const_iterator removal, bool release=true)
 Remove a specific change from the history.
 
virtual FASTDDS_EXPORTED_API iterator remove_change_nts (const_iterator removal, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time, bool release=true)
 Remove a specific change from the history.
 
FASTDDS_EXPORTED_API bool remove_all_changes ()
 Remove all changes from the History.
 
FASTDDS_EXPORTED_API bool remove_change (CacheChange_t *ch)
 Remove a specific change from the history.
 
FASTDDS_EXPORTED_API bool remove_change (CacheChange_t *ch, const std::chrono::time_point< std::chrono::steady_clock > &max_blocking_time)
 Remove a specific change from the history.
 
FASTDDS_EXPORTED_API const_iterator find_change (CacheChange_t *ch)
 Find a specific change in the history using the matches_change method criteria.
 
virtual FASTDDS_EXPORTED_API bool matches_change (const CacheChange_t *ch_inner, CacheChange_t *ch_outer)
 Verifies if an element of the changes collection matches a given change Derived classes have more info on how to identify univocally a change and should override.
 
FASTDDS_EXPORTED_API iterator remove_change (const_iterator removal, bool release=true)
 Remove a specific change from the history.
 
FASTDDS_EXPORTED_API iterator changesBegin ()
 Get the beginning of the changes history iterator.
 
FASTDDS_EXPORTED_API reverse_iterator changesRbegin ()
 
FASTDDS_EXPORTED_API iterator changesEnd ()
 Get the end of the changes history iterator.
 
FASTDDS_EXPORTED_API reverse_iterator changesRend ()
 
FASTDDS_EXPORTED_API bool get_min_change (CacheChange_t **min_change)
 Get the minimum CacheChange_t.
 
FASTDDS_EXPORTED_API bool get_max_change (CacheChange_t **max_change)
 Get the maximum CacheChange_t.
 
FASTDDS_EXPORTED_API uint32_t getTypeMaxSerialized ()
 Get the maximum serialized payload size.
 
FASTDDS_EXPORTED_API RecursiveTimedMutexgetMutex () const
 Get the mutex.
 
FASTDDS_EXPORTED_API bool get_change (const SequenceNumber_t &seq, const GUID_t &guid, CacheChange_t **change) const
 
const_iterator get_change_nts (const SequenceNumber_t &seq, const GUID_t &guid, CacheChange_t **change, const_iterator hint) const
 
bool get_earliest_change (CacheChange_t **change)
 A method to get the change with the earliest timestamp.
 

Public Attributes

HistoryAttributes m_att
 Attributes of the History.
 

Protected Member Functions

 History (const HistoryAttributes &att)
 
 History (History &&)=delete
 
Historyoperator= (History &&)=delete
 
virtual ~History ()
 
void print_changes_seqNum2 ()
 Print the seqNum of the changes in the History (for debuggisi, mng purposes).
 
virtual FASTDDS_EXPORTED_API void do_release_cache (CacheChange_t *ch)=0
 
History::iterator remove_iterator_constness (const_iterator c_it)
 Removes the constness of a const_iterator to obtain a regular iterator.
 

Protected Attributes

std::vector< CacheChange_t * > m_changes
 Vector of pointers to the CacheChange_t.
 
bool m_isHistoryFull = false
 Variable to know if the history is full without needing to block the History mutex.
 
RecursiveTimedMutexmp_mutex = nullptr
 Mutex for the History.
 

Detailed Description

Class History, container of the different CacheChanges and the methods to access them.

Member Typedef Documentation

◆ const_iterator

using const_iterator = std::vector<CacheChange_t*>::const_iterator

◆ iterator

using iterator = std::vector<CacheChange_t*>::iterator

◆ reverse_iterator

using reverse_iterator = std::vector<CacheChange_t*>::reverse_iterator

Constructor & Destructor Documentation

◆ History() [1/2]

History ( const HistoryAttributes att)
protected

◆ History() [2/2]

History ( History &&  )
protecteddelete

◆ ~History()

virtual ~History ( )
protectedvirtual

Member Function Documentation

◆ changesBegin()

FASTDDS_EXPORTED_API iterator changesBegin ( )
inline

Get the beginning of the changes history iterator.

Returns
Iterator to the beginning of the vector.

◆ changesEnd()

FASTDDS_EXPORTED_API iterator changesEnd ( )
inline

Get the end of the changes history iterator.

Returns
Iterator to the end of the vector.

◆ changesRbegin()

FASTDDS_EXPORTED_API reverse_iterator changesRbegin ( )
inline

◆ changesRend()

FASTDDS_EXPORTED_API reverse_iterator changesRend ( )
inline

◆ do_release_cache()

virtual FASTDDS_EXPORTED_API void do_release_cache ( CacheChange_t ch)
protectedpure virtual

Implemented in ReaderHistory, and WriterHistory.

◆ find_change()

FASTDDS_EXPORTED_API const_iterator find_change ( CacheChange_t ch)
inline

Find a specific change in the history using the matches_change method criteria.

Parameters
chPointer to the CacheChange_t to search for.
Returns
an iterator if a suitable change is found

◆ find_change_nts()

FASTDDS_EXPORTED_API const_iterator find_change_nts ( CacheChange_t ch)

Find a specific change in the history using the matches_change method criteria.

No Thread Safe

Parameters
chPointer to the CacheChange_t to search for.
Returns
an iterator if a suitable change is found

◆ get_change()

FASTDDS_EXPORTED_API bool get_change ( const SequenceNumber_t seq,
const GUID_t guid,
CacheChange_t **  change 
) const

◆ get_change_nts()

const_iterator get_change_nts ( const SequenceNumber_t seq,
const GUID_t guid,
CacheChange_t **  change,
const_iterator  hint 
) const

◆ get_earliest_change()

bool get_earliest_change ( CacheChange_t **  change)

A method to get the change with the earliest timestamp.

Parameters
changePointer to pointer to earliest change
Returns
True on success

◆ get_max_change()

FASTDDS_EXPORTED_API bool get_max_change ( CacheChange_t **  max_change)

Get the maximum CacheChange_t.

Parameters
max_changePointer to pointer to the maximum change.
Returns
True if correct.

◆ get_min_change()

FASTDDS_EXPORTED_API bool get_min_change ( CacheChange_t **  min_change)

Get the minimum CacheChange_t.

Parameters
min_changePointer to pointer to the minimum change.
Returns
True if correct.

◆ getHistorySize()

FASTDDS_EXPORTED_API size_t getHistorySize ( )
inline

Get the History size.

Returns
Size of the history.

◆ getMutex()

FASTDDS_EXPORTED_API RecursiveTimedMutex * getMutex ( ) const
inline

Get the mutex.

Returns
Mutex

◆ getTypeMaxSerialized()

FASTDDS_EXPORTED_API uint32_t getTypeMaxSerialized ( )
inline

Get the maximum serialized payload size.

Returns
Maximum serialized payload size

◆ isFull()

FASTDDS_EXPORTED_API bool isFull ( )
inline

Check if the history is full.

Returns
true if the History is full.

◆ matches_change()

virtual FASTDDS_EXPORTED_API bool matches_change ( const CacheChange_t ch_inner,
CacheChange_t ch_outer 
)
virtual

Verifies if an element of the changes collection matches a given change Derived classes have more info on how to identify univocally a change and should override.

Parameters
ch_innerelement of the collection to compare with the given change
ch_outerPointer to the CacheChange_t to identify.
Returns
true if the iterator identifies this change.

Reimplemented in ReaderHistory, and WriterHistory.

◆ operator=()

History & operator= ( History &&  )
protecteddelete

◆ print_changes_seqNum2()

void print_changes_seqNum2 ( )
protected

Print the seqNum of the changes in the History (for debuggisi, mng purposes).

◆ remove_all_changes()

FASTDDS_EXPORTED_API bool remove_all_changes ( )

Remove all changes from the History.

Returns
True if everything was correctly removed.

◆ remove_change() [1/3]

FASTDDS_EXPORTED_API bool remove_change ( CacheChange_t ch)

Remove a specific change from the history.

Parameters
chPointer to the CacheChange_t.
Returns
True if removed.

◆ remove_change() [2/3]

FASTDDS_EXPORTED_API bool remove_change ( CacheChange_t ch,
const std::chrono::time_point< std::chrono::steady_clock > &  max_blocking_time 
)

Remove a specific change from the history.

Parameters
chPointer to the CacheChange_t.
[in]max_blocking_timeMaximum time this method has to complete the task.
Returns
True if removed.

◆ remove_change() [3/3]

FASTDDS_EXPORTED_API iterator remove_change ( const_iterator  removal,
bool  release = true 
)
inline

Remove a specific change from the history.

Parameters
removaliterator to the CacheChange_t to remove.
releasedefaults to true and hints if the CacheChange_t should return to the pool
Returns
iterator to the next CacheChange_t or end iterator.

◆ remove_change_nts() [1/2]

virtual FASTDDS_EXPORTED_API iterator remove_change_nts ( const_iterator  removal,
bool  release = true 
)
virtual

Remove a specific change from the history.

No Thread Safe

Parameters
removaliterator to the CacheChange_t to remove.
releasedefaults to true and hints if the CacheChange_t should return to the pool
Returns
iterator to the next CacheChange_t or end iterator.

Reimplemented in ReaderHistory, and WriterHistory.

◆ remove_change_nts() [2/2]

virtual FASTDDS_EXPORTED_API iterator remove_change_nts ( const_iterator  removal,
const std::chrono::time_point< std::chrono::steady_clock > &  max_blocking_time,
bool  release = true 
)
virtual

Remove a specific change from the history.

No Thread Safe

Parameters
removaliterator to the CacheChange_t to remove.
[in]max_blocking_timeMaximum time this method has to complete the task.
releasedefaults to true and hints if the CacheChange_t should return to the pool
Returns
iterator to the next CacheChange_t or end iterator.

Reimplemented in ReaderHistory, and WriterHistory.

◆ remove_iterator_constness()

History::iterator remove_iterator_constness ( const_iterator  c_it)
protected

Removes the constness of a const_iterator to obtain a regular iterator.

This function takes a const_iterator as input and returns a regular iterator by removing the constness.

Parameters
c_itThe const_iterator to remove constness from.
Returns
An iterator with the same position as the input const_iterator.

Member Data Documentation

◆ m_att

Attributes of the History.

◆ m_changes

std::vector<CacheChange_t*> m_changes
protected

Vector of pointers to the CacheChange_t.

◆ m_isHistoryFull

bool m_isHistoryFull = false
protected

Variable to know if the history is full without needing to block the History mutex.

◆ mp_mutex

RecursiveTimedMutex* mp_mutex = nullptr
protected

Mutex for the History.


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