ML Reference
|
This class is a container for extended image properties derived from ImagePropertyExtension. More...
#include <mlImagePropertyExtensionContainer.h>
Public Member Functions | |
void | getValueAsString (std::string &valueAsString) const |
Conversion to string providing the same result as returned by operator<<. | |
Construction / Copy / Destruction / Equality operations. | |
ImagePropertyExtensionContainer () | |
Constructor which builds an empty container. | |
virtual | ~ImagePropertyExtensionContainer () |
Destructor. | |
ImagePropertyExtensionContainer (const ImagePropertyExtensionContainer &imagePropertyExtensionContainer) | |
Copy constructor from an existing ImagePropertyExtensionContainer object. | |
ImagePropertyExtensionContainer & | operator= (const ImagePropertyExtensionContainer &imagePropertyExtensionContainer) |
Assignment operator from an existing ImagePropertyExtension object, produces a copy. | |
bool | operator== (const ImagePropertyExtensionContainer &imagePropertyExtensionContainer) const |
Returns true if *this and imagePropertyExtensionContainer are identical, otherwise false. | |
bool | operator!= (const ImagePropertyExtensionContainer &imagePropertyExtensionContainer) const |
Returns true if *this and \ imagePropertyExtensionContainer are not identical, otherwise false. | |
Access property entries by index | |
size_t | getNumEntries () const |
Returns the number of property extensions in the container. | |
ImagePropertyExtension * | getEntry (size_t position) |
Returns the entry in container at index position (non-const version). | |
const ImagePropertyExtension * | getEntry (size_t position) const |
Returns the entry in container at index position (const version). | |
Search property entries. | |
int | findEntry (const ImagePropertyExtension *entry) const |
Searches for an entry referring to the specified entry and returns its index. | |
int | findFirstEntryOfType (const RuntimeType *runtimeType) const |
Searches for the first entry with RuntimeType runtimeType and returns its index. | |
ImagePropertyExtension * | getFirstEntryOfType (const RuntimeType *runtimeType) |
Returns the first entry in the container with runtime type runtimeType (non-const version). | |
const ImagePropertyExtension * | getFirstEntryOfType (const RuntimeType *runtimeType) const |
Returns the first entry in container with runtime type runtimeType (const version). | |
ImagePropertyExtensionVector | getEntriesOfType (const RuntimeType *runtimeType) |
Returns a vector of all property extensions of type runtimeType in the container. | |
ImagePropertyExtensionVector | cloneEntriesOfType (const RuntimeType *runtimeType) const |
Returns a vector of clones of all property extensions of type runtimeType in container. | |
size_t | getNumEntriesOfType (const RuntimeType *runtimeType) const |
Returns the number of property extensions of type runtimeType in the container. | |
Remove property entries. | |
void | clear () |
Removes all entries from the container. | |
bool | removeEntry (size_t position) |
Erases the entry at the given position from the container and deletes the corresponding PropertyExtension object. | |
bool | removeEntry (const ImagePropertyExtension *propertyExtension) |
Erases the entry referring to specified propertyExtension from the container and deletes the corresponding PropertyExtension object. | |
void | removeEntriesOfType (const RuntimeType *runtimeType) |
Removes all entries from the container which are of type runtimeType . | |
Append property entries. | |
void | append (ImagePropertyExtension *propertyExtension) |
Appends the PropertyExtension object \ propertyExtension at the end of the container. | |
ImagePropertyExtension * | appendClone (const ImagePropertyExtension &propertyExtension) |
Appends a clone of the PropertyExtension object propertyExtension at the end of the container and returns a pointer to the appended object. | |
Protected Member Functions | |
void | appendClones (const ImagePropertyExtensionContainer &container) |
Appends clones of entries of container to the container. | |
This class is a container for extended image properties derived from ImagePropertyExtension.
It is normally used as a member of MedicalImageProperties to allow adding own image property objects. See abstract base class ImagePropertyExtension for deriving such a property extension.
Definition at line 36 of file mlImagePropertyExtensionContainer.h.
ml::ImagePropertyExtensionContainer::ImagePropertyExtensionContainer | ( | ) |
Constructor which builds an empty container.
|
virtual |
Destructor.
ml::ImagePropertyExtensionContainer::ImagePropertyExtensionContainer | ( | const ImagePropertyExtensionContainer & | imagePropertyExtensionContainer | ) |
Copy constructor from an existing ImagePropertyExtensionContainer object.
void ml::ImagePropertyExtensionContainer::append | ( | ImagePropertyExtension * | propertyExtension | ) |
Appends the PropertyExtension object \ propertyExtension at the end of the container.
The object is not cloned. After appending, the object is managed by the container.
ImagePropertyExtension * ml::ImagePropertyExtensionContainer::appendClone | ( | const ImagePropertyExtension & | propertyExtension | ) |
Appends a clone of the PropertyExtension object propertyExtension
at the end of the container and returns a pointer to the appended object.
The object propExt remains under control of the caller.
|
protected |
Appends clones of entries of container
to the container.
void ml::ImagePropertyExtensionContainer::clear | ( | ) |
Removes all entries from the container.
ImagePropertyExtensionVector ml::ImagePropertyExtensionContainer::cloneEntriesOfType | ( | const RuntimeType * | runtimeType | ) | const |
Returns a vector of clones of all property extensions of type runtimeType
in container.
The caller is responsible of disposing the returned objects.
int ml::ImagePropertyExtensionContainer::findEntry | ( | const ImagePropertyExtension * | entry | ) | const |
Searches for an entry referring to the specified entry
and returns its index.
If no matching entry is found, -1 is returned.
int ml::ImagePropertyExtensionContainer::findFirstEntryOfType | ( | const RuntimeType * | runtimeType | ) | const |
Searches for the first entry with RuntimeType runtimeType
and returns its index.
If the entry is not found, -1 is returned.
ImagePropertyExtensionVector ml::ImagePropertyExtensionContainer::getEntriesOfType | ( | const RuntimeType * | runtimeType | ) |
Returns a vector of all property extensions of type runtimeType
in the container.
The pointers in the returned vector directly refer to the objects managed by the container.
ImagePropertyExtension * ml::ImagePropertyExtensionContainer::getEntry | ( | size_t | position | ) |
Returns the entry in container at index position
(non-const version).
If entry does not exist, NULL is returned. The returned pointer directly refers to the object managed by the container.
const ImagePropertyExtension * ml::ImagePropertyExtensionContainer::getEntry | ( | size_t | position | ) | const |
Returns the entry in container at index position (const version).
If entry does not exist, NULL is returned. The returned pointer directly refers to the object managed by the container.
ImagePropertyExtension * ml::ImagePropertyExtensionContainer::getFirstEntryOfType | ( | const RuntimeType * | runtimeType | ) |
Returns the first entry in the container with runtime type runtimeType
(non-const version).
If no entry is found, NULL is returned. The returned pointer directly refers to the object managed by the container.
const ImagePropertyExtension * ml::ImagePropertyExtensionContainer::getFirstEntryOfType | ( | const RuntimeType * | runtimeType | ) | const |
Returns the first entry in container with runtime type runtimeType
(const version).
If no entry is found, NULL is returned. The returned pointer directly refers to the object managed by the container.
size_t ml::ImagePropertyExtensionContainer::getNumEntries | ( | ) | const |
Returns the number of property extensions in the container.
size_t ml::ImagePropertyExtensionContainer::getNumEntriesOfType | ( | const RuntimeType * | runtimeType | ) | const |
Returns the number of property extensions of type runtimeType in the container.
void ml::ImagePropertyExtensionContainer::getValueAsString | ( | std::string & | valueAsString | ) | const |
Conversion to string providing the same result as returned by operator<<.
May be much faster with less memory foodprint especially on very large objects. Note that newlines are platform dependent.
bool ml::ImagePropertyExtensionContainer::operator!= | ( | const ImagePropertyExtensionContainer & | imagePropertyExtensionContainer | ) | const |
Returns true if *this and \ imagePropertyExtensionContainer are not identical, otherwise false.
Inequality includes differing sizes of containers, or inequality on ordered comparison on all properties in container in corresponding entries in extImageProps.
ImagePropertyExtensionContainer & ml::ImagePropertyExtensionContainer::operator= | ( | const ImagePropertyExtensionContainer & | imagePropertyExtensionContainer | ) |
Assignment operator from an existing ImagePropertyExtension object, produces a copy.
bool ml::ImagePropertyExtensionContainer::operator== | ( | const ImagePropertyExtensionContainer & | imagePropertyExtensionContainer | ) | const |
Returns true if *this and imagePropertyExtensionContainer
are identical, otherwise false.
Equality includes same sizes of containers, and equality on ordered comparison on all properties in container in corresponding entries in extImageProps.
void ml::ImagePropertyExtensionContainer::removeEntriesOfType | ( | const RuntimeType * | runtimeType | ) |
Removes all entries from the container which are of type runtimeType
.
bool ml::ImagePropertyExtensionContainer::removeEntry | ( | const ImagePropertyExtension * | propertyExtension | ) |
Erases the entry referring to specified propertyExtension from the container and deletes the corresponding PropertyExtension object.
If the entry is removed, true
is returned, otherwise false
.
bool ml::ImagePropertyExtensionContainer::removeEntry | ( | size_t | position | ) |
Erases the entry at the given position
from the container and deletes the corresponding PropertyExtension object.
If position
is out of range, the call is ignored. If the entry is removed, true
is returned, otherwise false
.