Aria
2.8.0
|
Helper class used to track changes to an Aria map. More...
#include <ArMapUtils.h>
Classes | |
struct | ArMapScanChangeDetails |
Summary of changes for a specific map scan type. More... | |
Public Types | |
enum | { CHANGE_TYPE_COUNT = LAST_CHANGE_TYPE + 1 } |
enum | MapLineChangeType { DELETIONS, ADDITIONS, LAST_CHANGE_TYPE = ADDITIONS } |
Public Member Functions | |
ArMapChangeDetails () | |
Constructor. | |
ArMapChangeDetails (const ArMapChangeDetails &other) | |
Copy constructor. | |
void | createChildArgMap () |
Creates a map of args that are considered to be a "child" of another arg. | |
std::list< std::string > | findChangedInfoNames () const |
Returns a list of the info types that have been changed. More... | |
ArMapFileLineSet * | getChangedInfoLines (const char *infoName, MapLineChangeType change) |
Returns a pointer to the specified info lines that have been changed. More... | |
std::vector< ArLineSegment > * | getChangedLineSegments (MapLineChangeType change, const char *scanType) |
Returns a pointer to the data line segments that have been changed for the specified scan type. More... | |
ArMapFileLineSet * | getChangedObjectLines (MapLineChangeType change) |
Returns a pointer to the map object (i.e. Cairn) lines that have been changed. More... | |
std::vector< ArPose > * | getChangedPoints (MapLineChangeType change, const char *scanType) |
Returns a pointer to the data points that have been changed for the specified scan type. More... | |
ArMapFileLineSet * | getChangedSummaryLines (MapLineChangeType change, const char *scanType) |
Returns a pointer to the header lines that have been changed for the specified scan type. More... | |
ArMapFileLineSet * | getChangedSupplementLines (MapLineChangeType change) |
Returns a pointer to the map supplement lines that have been changed. More... | |
bool | getNewMapId (ArMapId *mapIdOut) |
Returns the new post-change map ID. More... | |
bool | getOrigMapId (ArMapId *mapIdOut) |
Returns the original pre-change map ID. More... | |
std::list< std::string > * | getScanTypes () |
Returns a pointer to the list of scan types that have been modified. More... | |
bool | isChildArg (const char *infoName, ArArgumentBuilder *arg) const |
Determines whether the given argument for the specified info type is a "child". More... | |
bool | isChildArg (const char *infoName, const char *arg0Text) const |
Determines whether the given arg 0 for the info type is a "child". | |
void | lock () |
Locks the change details for multithreaded access. | |
void | log () |
Writes the change details to the Aria log. | |
ArMapChangeDetails & | operator= (const ArMapChangeDetails &other) |
Assignment operator. | |
void | setNewMapId (const ArMapId &mapId) |
Sets the new post-change map ID. More... | |
void | setOrigMapId (const ArMapId &mapId) |
Sets the original pre-change map ID. More... | |
void | unlock () |
~ArMapChangeDetails () | |
Destructor. | |
Protected Member Functions | |
ArMapScanChangeDetails * | getScanChangeDetails (const char *scanType) |
Protected Attributes | |
ArMapFileLineSet | myChangedObjectLines [CHANGE_TYPE_COUNT] |
Change details for the map's object list. | |
ArMapFileLineSet | myChangedSupplementLines [CHANGE_TYPE_COUNT] |
Change details for the map's supplemental data. | |
std::map< std::string, std::map< std::string, bool > > | myInfoNameToMapOfChildArgsMap |
Map of info type identifiers to argument types, and whether each argument type is a child. | |
std::map< std::string, ArMapFileLineSet > | myInfoToChangeMaps [CHANGE_TYPE_COUNT] |
Change details for the map's info data. | |
ArMutex | myMutex |
Mutex to protect multithreaded access. | |
ArMapId | myNewMapId |
Identifier of the map after the changes were made. | |
ArMapScanChangeDetails | myNullScanTypeChanges |
Value returned when no scan data was changed. | |
ArMapId | myOrigMapId |
Identifier of the map before the changes were made. | |
std::list< std::string > | myScanTypeList |
List of scan types included in the change details. | |
std::map< std::string, ArMapScanChangeDetails * > | myScanTypeToChangesMap |
Map of scan types to the changes for the scan. | |
Helper class used to track changes to an Aria map.
ArMapChangeDetails is a simple helper class that is used to track changes to an Aria map. These changes are determined based on set comparisons (and thus everything in the map must be ordered in a repeatable manner).
The class itself provides very little functionality. It is basically a repository of change information that may be accessed directly by the application. The methods return pointers to the internal data members which may be directly manipulated. There is no error checking, thread-safety, etc. The class's use and scope is expected to be very limited (to the Aria map and related classes).
Java and Python Wrappers: Not available in Java or Python wrapper libraries.
std::list< std::string > ArMapChangeDetails::findChangedInfoNames | ( | ) | const |
Returns a list of the info types that have been changed.
This method searches the internal changed info lines and returns the info types that have non-empty change information.
ArMapFileLineSet * ArMapChangeDetails::getChangedInfoLines | ( | const char * | infoName, |
MapLineChangeType | change | ||
) |
Returns a pointer to the specified info lines that have been changed.
infoName | the int identifier of the info type to be returned |
change | the MapLineChangeType that indicates whether added or removed map info lines are to be returned |
std::vector< ArLineSegment > * ArMapChangeDetails::getChangedLineSegments | ( | MapLineChangeType | change, |
const char * | scanType | ||
) |
Returns a pointer to the data line segments that have been changed for the specified scan type.
change | the MapLineChangeType that indicates whether added or removed line segments are to be returned |
scanType | the const char * identifier of the scan for which the line segments are to be returned; must be non-NULL |
ArMapFileLineSet * ArMapChangeDetails::getChangedObjectLines | ( | MapLineChangeType | change | ) |
Returns a pointer to the map object (i.e. Cairn) lines that have been changed.
change | the MapLineChangeType that indicates whether added or removed map object lines are to be returned |
std::vector< ArPose > * ArMapChangeDetails::getChangedPoints | ( | MapLineChangeType | change, |
const char * | scanType | ||
) |
Returns a pointer to the data points that have been changed for the specified scan type.
change | the MapLineChangeType that indicates whether added or removed points are to be returned |
scanType | the const char * identifier of the scan for which the points are to be returned; must be non-NULL |
ArMapFileLineSet * ArMapChangeDetails::getChangedSummaryLines | ( | MapLineChangeType | change, |
const char * | scanType | ||
) |
Returns a pointer to the header lines that have been changed for the specified scan type.
change | the MapLineChangeType that indicates whether added or removed scan header lines are to be returned |
scanType | the const char * identifier of the scan for which the changes are to be returned; must be non-NULL |
ArMapFileLineSet * ArMapChangeDetails::getChangedSupplementLines | ( | MapLineChangeType | change | ) |
Returns a pointer to the map supplement lines that have been changed.
change | the MapLineChangeType that indicates whether added or removed supplement lines are to be returned |
bool ArMapChangeDetails::getNewMapId | ( | ArMapId * | mapIdOut | ) |
Returns the new post-change map ID.
mapIdOut | a pointer to the ArMapId to be returned |
bool ArMapChangeDetails::getOrigMapId | ( | ArMapId * | mapIdOut | ) |
Returns the original pre-change map ID.
mapIdOut | a pointer to the ArMapId to be returned |
|
protected |
ArLog::log(ArLog::Normal, "ArMapChangeDetails::getScanChangeDetails() adding details for scan type %s", scanType);
std::list< std::string > * ArMapChangeDetails::getScanTypes | ( | ) |
Returns a pointer to the list of scan types that have been modified.
This list includes the scan types in the map before and after it was changed. Scan types usually won't be added or removed, but it may occur when one map is inserted into another. A pointer to the actual internal attribute is returned.
bool ArMapChangeDetails::isChildArg | ( | const char * | infoName, |
ArArgumentBuilder * | arg | ||
) | const |
Determines whether the given argument for the specified info type is a "child".
"Child" arguments have a non-NULL parent. For example, an argument that represents a robot task may be a child of one that defines a macro. When a child argument is changed, then the parent and all of its children must be included in the change details. Note that currently only one level of parent-ness is supported (i.e. there are no grandparents).
void ArMapChangeDetails::setNewMapId | ( | const ArMapId & | mapId | ) |
Sets the new post-change map ID.
mapId | the ArMapId of the map after it was changed |
void ArMapChangeDetails::setOrigMapId | ( | const ArMapId & | mapId | ) |
Sets the original pre-change map ID.
mapId | the ArMapId of the map before it was changed |