|
Teamcenter C++ API Reference
2312
|
An indexed map of errors. Filters out ITK_ok errors on addition. ErrorMap implements a set-based style of error reporting, very different from Teamcenter ITK-style error stacks. We expect clients to return ErrorMaps from set-based functions, and the class is optimized for this use case. Clietns will associate each Error with an array index identifier. The ErrorMap class conceptually stacks up Errors under these index identifiers, returning the most recent. Clients may need to re-map index identifiers as they pass ErrorMaps up the call chain. More...
#include <error_map.hxx>
Public Types | |
| typedef StdSmMap< size_t, Error >::Map::const_iterator | const_iterator |
| typedef StdSmMap< size_t, Error >::Map::iterator | iterator |
| stl-like iterators. More... | |
| typedef size_t | key_type |
| stl-like typedefs. More... | |
| typedef Error | mapped_type |
| typedef StdSmMap< size_t, Error >::Map::value_type | value_type |
Public Member Functions | |
| ErrorMap & | add (size_t id, Error const &error) |
| Add an individual error to the error set. Discard all but the most recent error. More... | |
| ErrorMap & | add (size_t id, int ifail) |
| Add an individual integer fail code to the error set. Handle the ifail by taking ownership of (clearing) the current error stack. More... | |
| ErrorMap & | add (size_t id, IFail const &ifail) |
| Add an individual IFail to the error set. Handle the ifail by taking ownership of (clearing) the current error stack. More... | |
| ErrorMap & | add (size_t id, status_t const &status) |
| Add an individual status_t to the error set. Handle the ifail by taking ownership of (clearing) the current error stack. More... | |
| iterator | begin () |
| stl-like iteration. More... | |
| const_iterator | begin () const |
| bool | empty () const |
| stl-like is map empty? More... | |
| iterator | end () |
| const_iterator | end () const |
| ErrorMap () | |
| Empty set - no errors. More... | |
| ErrorMap (ErrorMap const &) | |
| iterator | find (size_t id) |
| stl-like map lookup. More... | |
| const_iterator | find (size_t id) const |
| ErrorMap & | operator+= (ErrorMap const &right) |
| Update with the latest errors. More recent (right) errors, replace older (this) errors. More... | |
| ErrorMap & | operator= (ErrorMap const &) |
| size_t | size () const |
| stl-like map size. More... | |
Private Types | |
| typedef StdSmMap< size_t, Error >::Map | StdErrorMap |
Private Member Functions | |
| StdErrorMap & | ensureMap () |
| Ensure m_map is allocated, and return a reference.s. More... | |
Private Attributes | |
| StdErrorMap | m_emptyMap |
| shared_ptr< StdErrorMap > | m_map |
An indexed map of errors. Filters out ITK_ok errors on addition. ErrorMap implements a set-based style of error reporting, very different from Teamcenter ITK-style error stacks. We expect clients to return ErrorMaps from set-based functions, and the class is optimized for this use case. Clietns will associate each Error with an array index identifier. The ErrorMap class conceptually stacks up Errors under these index identifiers, returning the most recent. Clients may need to re-map index identifiers as they pass ErrorMaps up the call chain.
sample:
Definition at line 165 of file error_map.hxx.
| typedef StdSmMap< size_t, Error >::Map::const_iterator Teamcenter::ErrorMap::const_iterator |
Definition at line 198 of file error_map.hxx.
| typedef StdSmMap< size_t, Error >::Map::iterator Teamcenter::ErrorMap::iterator |
stl-like iterators.
Definition at line 197 of file error_map.hxx.
| typedef size_t Teamcenter::ErrorMap::key_type |
stl-like typedefs.
Definition at line 192 of file error_map.hxx.
Definition at line 193 of file error_map.hxx.
|
private |
Definition at line 216 of file error_map.hxx.
| typedef StdSmMap< size_t, Error >::Map::value_type Teamcenter::ErrorMap::value_type |
Definition at line 194 of file error_map.hxx.
|
inline |
Empty set - no errors.
Definition at line 323 of file error_map.hxx.
|
inline |
Definition at line 329 of file error_map.hxx.
Add an individual error to the error set. Discard all but the most recent error.
|
inline |
Add an individual integer fail code to the error set. Handle the ifail by taking ownership of (clearing) the current error stack.
Definition at line 344 of file error_map.hxx.
Add an individual IFail to the error set. Handle the ifail by taking ownership of (clearing) the current error stack.
Definition at line 349 of file error_map.hxx.
Add an individual status_t to the error set. Handle the ifail by taking ownership of (clearing) the current error stack.
Definition at line 354 of file error_map.hxx.
|
inline |
stl-like iteration.
Definition at line 374 of file error_map.hxx.
|
inline |
Definition at line 390 of file error_map.hxx.
|
inline |
stl-like is map empty?
Definition at line 366 of file error_map.hxx.
|
inline |
Definition at line 382 of file error_map.hxx.
|
inline |
Definition at line 398 of file error_map.hxx.
|
inlineprivate |
Ensure m_map is allocated, and return a reference.s.
| iterator Teamcenter::ErrorMap::find | ( | size_t | id | ) |
stl-like map lookup.
| const_iterator Teamcenter::ErrorMap::find | ( | size_t | id | ) | const |
Update with the latest errors. More recent (right) errors, replace older (this) errors.
Definition at line 335 of file error_map.hxx.
|
inline |
stl-like map size.
Definition at line 359 of file error_map.hxx.
|
private |
Empty map for iteration when m_map is unallocated.
Definition at line 231 of file error_map.hxx.
|
private |
Owned errors are stored in this map.
Definition at line 225 of file error_map.hxx.