#include <mrpt/slam/CRawlogXXL.h>
Classes | |
class | const_iterator |
A normal const iterator, plus the extra methods to determine the type of each entry in the sequence. More... | |
class | iterator |
A normal iterator, plus the extra methods to determine the type of each entry in the sequence. More... | |
struct | TObjectElementXXL |
Public Types | |
enum | TEntryType { etSensoryFrame = 0, etActionCollection, etObservation } |
The type of each entry in a rawlog. More... | |
Public Member Functions | |
bool | isOK () |
Whether the temporary swap file has been opened correctly. | |
CRawlogXXL () | |
Default constructor:. | |
virtual | ~CRawlogXXL () |
Copy operator:. | |
void | clear () |
Clear the sequence of actions/observations, freeing the memory of all the objects in the list. | |
void | clearWithoutDelete () |
Clear the sequence of actions/observations, without deleting the objects themselves (USE ONLY IF YOU KNOW WHAT YOU DO, NORMALLY YOU'LL CALL "clear" INSTEAD). | |
void | addAction (CAction &action) |
Add an action to the sequence: a collection of just one element is created. | |
void | addActions (CActionCollection &action) |
Add a set of actions to the sequence; the object is duplicated, so the original one can be free if desired. | |
void | addObservations (CSensoryFrame &observations) |
Add a set of observations to the sequence; the object is duplicated, so the original one can be free if desired. | |
void | addActionsMemoryReference (const CActionCollectionPtr &action) |
Add a set of actions to the sequence, using a smart pointer to the object to add. | |
void | addObservationsMemoryReference (const CSensoryFramePtr &observations) |
Add a set of observations to the sequence, using a smart pointer to the object to add. | |
void | addObservationMemoryReference (const CObservationPtr &observation) |
Add a single observation to the sequence, using a smart pointer to the object to add. | |
bool | loadFromRawLogFile (const std::string &fileName) |
Load the contents from a file containing one of these possibilities:
| |
size_t | size () |
Returns the number of actions / observations object in the sequence. | |
MRPT_DEPRECATED_PRE bool | isAction (size_t index) MRPT_DEPRECATED_POST |
Returns true if the given object is an action, or false if it is a set of observations, where index=0 is the first object. | |
TEntryType | getType (size_t index) const |
Returns the type of a given element. | |
void | remove (size_t index) |
Delete the action or observation stored in the given index. | |
CActionCollectionPtr | getAsAction (size_t index) |
Returns the i'th element in the sequence, as being actions, where index=0 is the first object. | |
CSensoryFramePtr | getAsObservations (size_t index) |
Returns the i'th element in the sequence, as being an action, where index=0 is the first object. | |
CSerializablePtr | getAsGeneric (size_t index) |
Returns the i'th element in the sequence, being its class whatever. | |
CObservationPtr | getAsObservation (size_t index) |
Returns the i'th element in the sequence, as being an observation, where index=0 is the first object. | |
const_iterator | begin () const |
iterator | begin () |
const_iterator | end () const |
iterator | end () |
iterator | remove (const iterator &it) |
void | moveFrom (CRawlogXXL &obj) |
Efficiently copy the contents from other existing object, and remove the data from the origin (after calling this, the original object will have no actions/observations). | |
void | swap (CRawlogXXL &obj) |
Efficiently swap the contents of two existing objects. | |
Private Types | |
typedef std::deque < TObjectElementXXL > | TListObjects |
Private Member Functions | |
void | assureElementIsLoaded (size_t index, bool swapOutOldEntries=true) |
If the given objects is not in memory, bring it back from disk (and possibly send others to disk). | |
void | swapEntryToDisk (size_t index) |
Swap entry to disk. | |
void | swapEntriesToDiskIfRequired (const TTimeStamp tnow) |
Swap entries out to disk if required. | |
Private Attributes | |
TListObjects | m_seqOfActObs |
The list where the objects really are in. | |
mrpt::utils::CFileStream | m_tempFile |
The file with the "disk-swapped" objects. | |
size_t | m_objectsInMemory |
How many objects are actually in memory instead of the swap file. | |
Static Private Attributes | |
static const size_t | INVALID_POS |
By default, this class behaves like CRawlog, until the amount of memory used by the current proccess reaches a given limit indicated in the constructor.
Definition at line 49 of file CRawlogXXL.h.
typedef std::deque<TObjectElementXXL> mrpt::slam::CRawlogXXL::TListObjects [private] |
Definition at line 69 of file CRawlogXXL.h.
The type of each entry in a rawlog.
Definition at line 93 of file CRawlogXXL.h.
mrpt::slam::CRawlogXXL::CRawlogXXL | ( | ) |
Default constructor:.
virtual mrpt::slam::CRawlogXXL::~CRawlogXXL | ( | ) | [virtual] |
void mrpt::slam::CRawlogXXL::addAction | ( | CAction & | action | ) |
Add an action to the sequence: a collection of just one element is created.
The object is duplicated, so the original one can be free if desired.
void mrpt::slam::CRawlogXXL::addActions | ( | CActionCollection & | action | ) |
Add a set of actions to the sequence; the object is duplicated, so the original one can be free if desired.
void mrpt::slam::CRawlogXXL::addActionsMemoryReference | ( | const CActionCollectionPtr & | action | ) |
Add a set of actions to the sequence, using a smart pointer to the object to add.
void mrpt::slam::CRawlogXXL::addObservationMemoryReference | ( | const CObservationPtr & | observation | ) |
Add a single observation to the sequence, using a smart pointer to the object to add.
void mrpt::slam::CRawlogXXL::addObservations | ( | CSensoryFrame & | observations | ) |
Add a set of observations to the sequence; the object is duplicated, so the original one can be free if desired.
void mrpt::slam::CRawlogXXL::addObservationsMemoryReference | ( | const CSensoryFramePtr & | observations | ) |
Add a set of observations to the sequence, using a smart pointer to the object to add.
void mrpt::slam::CRawlogXXL::assureElementIsLoaded | ( | size_t | index, | |
bool | swapOutOldEntries = true | |||
) | [private] |
If the given objects is not in memory, bring it back from disk (and possibly send others to disk).
iterator mrpt::slam::CRawlogXXL::begin | ( | ) | [inline] |
Definition at line 309 of file CRawlogXXL.h.
const_iterator mrpt::slam::CRawlogXXL::begin | ( | ) | const [inline] |
Definition at line 308 of file CRawlogXXL.h.
void mrpt::slam::CRawlogXXL::clear | ( | ) |
Clear the sequence of actions/observations, freeing the memory of all the objects in the list.
void mrpt::slam::CRawlogXXL::clearWithoutDelete | ( | ) |
Clear the sequence of actions/observations, without deleting the objects themselves (USE ONLY IF YOU KNOW WHAT YOU DO, NORMALLY YOU'LL CALL "clear" INSTEAD).
iterator mrpt::slam::CRawlogXXL::end | ( | ) | [inline] |
Definition at line 311 of file CRawlogXXL.h.
const_iterator mrpt::slam::CRawlogXXL::end | ( | ) | const [inline] |
Definition at line 310 of file CRawlogXXL.h.
CActionCollectionPtr mrpt::slam::CRawlogXXL::getAsAction | ( | size_t | index | ) |
Returns the i'th element in the sequence, as being actions, where index=0 is the first object.
If it is not a CActionCollection, it throws an exception. Do neighter modify nor delete the returned pointer.
std::exception | If index is out of bounds |
CSerializablePtr mrpt::slam::CRawlogXXL::getAsGeneric | ( | size_t | index | ) |
Returns the i'th element in the sequence, being its class whatever.
std::exception | If index is out of bounds |
CObservationPtr mrpt::slam::CRawlogXXL::getAsObservation | ( | size_t | index | ) |
Returns the i'th element in the sequence, as being an observation, where index=0 is the first object.
If it is not an CObservation, it throws an exception. Do neighter modify nor delete the returned pointer. This is the proper method to obtain the objects stored in a "only observations"-rawlog file (named "format #2" above.
std::exception | If index is out of bounds |
CSensoryFramePtr mrpt::slam::CRawlogXXL::getAsObservations | ( | size_t | index | ) |
Returns the i'th element in the sequence, as being an action, where index=0 is the first object.
If it is not an CSensoryFrame, it throws an exception. Do neighter modify nor delete the returned pointer.
std::exception | If index is out of bounds |
TEntryType mrpt::slam::CRawlogXXL::getType | ( | size_t | index | ) | const |
MRPT_DEPRECATED_PRE bool mrpt::slam::CRawlogXXL::isAction | ( | size_t | index | ) |
Returns true if the given object is an action, or false if it is a set of observations, where index=0 is the first object.
std::exception | If index is out of bounds |
bool mrpt::slam::CRawlogXXL::isOK | ( | ) |
Whether the temporary swap file has been opened correctly.
bool mrpt::slam::CRawlogXXL::loadFromRawLogFile | ( | const std::string & | fileName | ) |
Load the contents from a file containing one of these possibilities:
void mrpt::slam::CRawlogXXL::moveFrom | ( | CRawlogXXL & | obj | ) |
Efficiently copy the contents from other existing object, and remove the data from the origin (after calling this, the original object will have no actions/observations).
void mrpt::slam::CRawlogXXL::remove | ( | size_t | index | ) |
Delete the action or observation stored in the given index.
std::exception | If index is out of bounds |
size_t mrpt::slam::CRawlogXXL::size | ( | ) |
Returns the number of actions / observations object in the sequence.
void mrpt::slam::CRawlogXXL::swap | ( | CRawlogXXL & | obj | ) |
Efficiently swap the contents of two existing objects.
void mrpt::slam::CRawlogXXL::swapEntriesToDiskIfRequired | ( | const TTimeStamp | tnow | ) | [private] |
Swap entries out to disk if required.
void mrpt::slam::CRawlogXXL::swapEntryToDisk | ( | size_t | index | ) | [private] |
Swap entry to disk.
const size_t mrpt::slam::CRawlogXXL::INVALID_POS [static, private] |
Definition at line 57 of file CRawlogXXL.h.
size_t mrpt::slam::CRawlogXXL::m_objectsInMemory [private] |
How many objects are actually in memory instead of the swap file.
Definition at line 74 of file CRawlogXXL.h.
Page generated by Doxygen 1.5.9 for MRPT 0.6.5 SVN: at Sun Aug 2 11:39:56 CDT 2009 |