|
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members
PmtCompositeMetadata Class ReferenceThe PmtCompositeMetadata class is a container for other metadata (including other composite metadata).
More...
#include <PmtCompositeMetadata.h>
Inheritance diagram for PmtCompositeMetadata: [legend]Collaboration diagram for PmtCompositeMetadata:[legend]List of all members.
Public Methods |
| PmtCompositeMetadata () |
| Default Constructor. More...
|
| PmtCompositeMetadata (const PmtKeyType &mdKey, const SPmtString &type, const SPmtString &trueType) |
| Constructor. defaultCompositeFactoryKey = "composite". More...
|
| PmtCompositeMetadata (const PmtCompositeMetadata &orig) |
| Copy constructor. More...
|
| PmtCompositeMetadata (const PmtCompositeMetadata &orig, PmtCompositeMetadata *theParent) |
| Copy constructor. More...
|
virtual | ~PmtCompositeMetadata () |
| This is the destructor. More...
|
PmtCompositeMetadata & | operator= (const PmtCompositeMetadata &rhs) |
| Assignment operator. More...
|
virtual bool | isComposite () const |
| Returns true if the metadata is a composite. More...
|
virtual PmtMetadataPtr | getMetadatum (const PmtKeyType &key, bool createMetadataIfNotExists=true) |
| Returns an reference to a metadata instance whose key matched the specified key. More...
|
virtual PmtMetadataIterator | getMetadata (const PmtKeyType &key, bool createMetadataIfNotExists=true, const PmtEntryTypeEnum entryToSearch=PMT_ALL_KEYS) |
| Create retrieve metadata instances. More...
|
virtual PmtMetadataIterator | getMetadata (const PmtKeyList &keyList, bool createMetadataIfNotExists=true, const PmtEntryTypeEnum entryToSearch=PMT_ALL_KEYS) |
| Create retrieve metadata instances. More...
|
virtual void | deleteMetadata (const PmtKeyType &key, const PmtEntryTypeEnum entryToSearch=PMT_ALL_KEYS) |
| Delete metadata instances. More...
|
virtual void | deleteMetadata (const PmtKeyList &keyList, const PmtEntryTypeEnum entryToSearch=PMT_ALL_KEYS) |
| Delete metadata instances. More...
|
virtual PmtMetadata * | clone (void) const |
| Return a "deep" copy of the instance. More...
|
virtual PmtMetadataPtr | clone (PmtCompositeMetadata *theParent) const |
| Return a "deep" copy of the instance. More...
|
virtual void | accept (PmtMetadataVisitor *visitor) |
| For VIM visitor concept. More...
|
virtual void | accept (PmtMdVisitorImpl *visitor) |
| For VIM visitor concept. More...
|
virtual void | show (bool showObjectMemoryPointers=false, int level=0, bool showModelGroups=false) |
| Show metadata object. More...
|
virtual ostream & | printDerived (ostream &c) const |
| DEPRECIATED - Write derived class values. More...
|
const PmtModelGroupPtr & | modelGroup (void) const |
PmtModelGroupPtr & | modelGroup (void) |
void | addMetadataKey (const PmtMetadataList::iterator &mdIter) |
Detailed Description
The PmtCompositeMetadata class is a container for other metadata (including other composite metadata).
Since it is derived from the PmtMetadata class, it is-a metadata, and has an associated metadata key and type. However, there is no metadata value associated with this class. PmtCompositeMetadata is mapped to the <complexType> construct of the Metadata Definition Language; therefore, its type is the value assigned to the name attribute of the <complexType>.
Constructor & Destructor Documentation
PmtCompositeMetadata::PmtCompositeMetadata |
( |
|
) |
[inline] |
|
|
Constructor. defaultCompositeFactoryKey = "composite".
|
PmtCompositeMetadata::PmtCompositeMetadata |
( |
const PmtCompositeMetadata & |
orig |
) |
[inline] |
|
PmtCompositeMetadata::PmtCompositeMetadata |
( |
const PmtCompositeMetadata & |
orig, |
|
|
PmtCompositeMetadata * |
theParent |
|
) |
[inline] |
|
virtual PmtCompositeMetadata::~PmtCompositeMetadata |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
|
For VIM visitor concept.
Reimplemented from PmtMetadata. |
|
For VIM visitor concept.
Reimplemented from PmtMetadata. |
void PmtCompositeMetadata::addMetadataKey |
( |
const PmtMetadataList::iterator & |
mdIter |
) |
[inline] |
|
virtual PmtMetadataPtr PmtCompositeMetadata::clone |
( |
PmtCompositeMetadata * |
theParent |
) |
const [inline, virtual] |
|
|
Return a "deep" copy of the instance.
This is here for the metadata factory to allow it to create instances from the prototype metadata instances it contains.
Implements PmtMetadata. |
virtual PmtMetadata* PmtCompositeMetadata::clone |
( |
void |
|
) |
const [inline, virtual] |
|
|
Return a "deep" copy of the instance.
This is here for the metadata factory to allow it to create instances from the prototype metadata instances it contains.
Implements PmtMetadata.
Reimplemented in PmtRootMetadata. |
void PmtCompositeMetadata::deleteMetadata |
( |
const PmtKeyList & |
keyList, |
|
|
const PmtEntryTypeEnum |
entryToSearch = PMT_ALL_KEYS |
|
) |
[virtual] |
|
|
Delete metadata instances.
-
Parameters:
-
keyList |
is of type PmtKeylist and is a list of qualified key of the metadata instance, a wildcard qualified metadata key, an alias key, or a mixture of any of these. |
entryToSearch |
is of type PmtEntryTypeEnum. Allows one to limit the key search to just the metadata keys (PMT_METADATA_KEYS_ONLY) or alias keys (PMT_ALIAS_KEYS_ONLY). The default is to seach all keys (PMT_ALL_KEY). |
The behavior of this method is identical to PmtCompositeMetadata::deleteMetadata(const PmtKeyType& key, const PmtEntryTypeEnum entryToSearch)
Reimplemented from PmtMetadata. |
void PmtCompositeMetadata::deleteMetadata |
( |
const PmtKeyType & |
key, |
|
|
const PmtEntryTypeEnum |
entryToSearch = PMT_ALL_KEYS |
|
) |
[virtual] |
|
|
Delete metadata instances.
-
Parameters:
-
key |
is of type PmtKeyType and is the qualified key of the metadata instance, a wildcard qualified metadata key or an alias key. |
entryToSearch |
is of type PmtEntryTypeEnum. Allows one to limit the key search to just the metadata keys (PMT_METADATA_KEYS_ONLY) or alias keys (PMT_ALIAS_KEYS_ONLY). The default is to seach all keys (PMT_ALL_KEY). |
For the examples below, assume that the default schema is what's loaded, and that the root composite is what's getting called through, like this:
If a simple key is supplied, such as CaptureConditions, then the metadata instance will be deleted. If the specified metadata is an instance of PmtCompositeMetadata, then all its children will be recursively deleted.
If a quilified key is supplied, such as CaptureConditions.Aperture, then the metadata instance with the key matching Aperture within CaptureConditions will be deleted.
If a wildcard key of the form CaptureConditions.* is supplied, then all of the metadata items contained within CaptureConditions will be deleted.
If a wildcard key of the form Capture* is supplied, then all the metadata items that match the wildcard (from the default schema this includes CaptureConditions and CaptureDevice) will be deleted. Also, if any aliases match the wildcard (assuming an alias file is loaded), and entryToSearch does not equal PMT_METADATA_KEYS_ONLY, then any aliases beginning with Capture would also be deleted.
If "*" is supplied, then all the metadata instances contained within the composite are deleted.
If "" , an empty key, is supplied, this method will do nothing.
This method will perform automatic deletions of PmtCompositeMetadata instances when all of their children have been deleted. This happens only when the children have been deleted from their parent PmtCompositeMetadata (or higher parent). For example, if the key CaptureDevice.Scanner.ModelAndVersion is deleted like this:
PmtMetadataPtr captureDevice = root->getMetadatum("CaptureDevice");
captureDevice->deleteMetadata("Scanner.ModelAndVersion");
then the Scanner metadata instance will get deleted too, since it's only child has been deleted. This applies to the situation in which the delete is issued to the root metadata instance:
root->deleteMetadata("CaptureDevice.Scanner.ModelAndVersion");
additionally, in this case the PmtCompositeMetadata instance for CaptureDevice is also deleted.
If however, ModelAndVersion were deleted like this:
PmtMetadataPtr scanner = root->getMetadatum("CaptureDevice.Scanner");
scanner->deleteMetadata("ModelAndVersion");
then ModelAndVersion would get deleted. However, because the application has a handle to the Scanner instance, it is not deleted.
The entryToSearch parameter specifies if regular metadata keys, aliases, or both are searched to determine which metadata instances are to be deleted. PMT_ALL_KEYS, the default, means that if an alias file is loaded, then both regular metadata keys and aliases (including wildcards) will be deleted. PMT_METADATA_KEYS_ONLY means that only regular keys will match, whereas PMT_ALIAS_KEYS_ONLY means that only aliases will match. The key may be either and alias or a metadata key.
Reimplemented from PmtMetadata. |
|
Create retrieve metadata instances.
-
Parameters:
-
keyList |
is of type PmtKeylist and is a list of qualified key of the metadata instance, a wildcard qualified metadata key, an alias key, or a mixture of any of these. |
createMetadataIfNotExists |
is of type bool and controls the behavior of the creation of non-existant metadata. Default is true - create if it does not exist. false will not create |
entryToSearch |
is of type PmtEntryTypeEnum. Allows one to limit the key search to just the metadata keys (PMT_METADATA_KEYS_ONLY) or alias keys (PMT_ALIAS_KEYS_ONLY). The default is to seach all keys (PMT_ALL_KEY). |
-
Returns:
-
A PmtMetadataIterator instance containing references to metadata instances.
The behavior of this method is identical to PmtCompositeMetadata::getMetadata(const PmtKeyType& key, bool createMetadataIfNotExists, const PmtEntryTypeEnum entryToSearch)
Reimplemented from PmtMetadata. |
|
Create retrieve metadata instances.
-
Parameters:
-
key |
is of type PmtKeyType and is the qualified key of the metadata instance, a wildcard qualified metadata key or an alias key. |
createMetadataIfNotExists |
is of type bool and controls the behavior of the creation of non-existant metadata. Default is true - create if it does not exist. false will not create |
entryToSearch |
is of type PmtEntryTypeEnum. Allows one to limit the key search to just the metadata keys (PMT_METADATA_KEYS_ONLY) or alias keys (PMT_ALIAS_KEYS_ONLY). The default is to seach all keys (PMT_ALL_KEY). |
-
Returns:
-
A PmtMetadataIterator instance containing references to metadata instances.
This method will create, if necessary and if createMetadataIfNotExists is set ture (the default), and return references to multiple metadata instances through the PmtMetadataIterator instance that is actually returned. The key maybe a qualified metadata key, a wildcard metadata key, or an alias key. Metadata is created and cached for quick retrieval and value retention when subsequent getMetadata calls are made.
If a simple key is supplied, such as CaptureConditions, then the CaptureConditions metadata item will be returned.
If a qualified key , such as CaptureConditions.Aperture is specfied, then the Aperture metadata instance within CaptureConditions will be returned. If needed, CaptureConditions itself will be created, although not returned.
If "*" is specified, then all metadata contained within this composite are created, if necessary, and returned.
If "" , an empty key, is specified, then all pre-existing metadata instances within this composite will be returned. No new items will be instantiated regardless as to the value of createMetadataIfNotExists.
If a wildcard key such as CaptureConditions.* is specified, then the CaptureConditions composite will be instantiated (if it already hasn't been), and all the items within CaptureConditions will be instantiated, if need be, and returned. The PmtCompositeMetadata instance for CaptureConditions will not be returned.
If a wildcard key such as Capture* is specified, then all the metadata items that match the wildcard (from the default schema this includes CaptureConditions and CaptureDevice) would be created, if necessary, and any metadata contained within them will be recursively created and returned. Also, if any aliases match the wildcard (assuming an alias file is loaded), and entryToSearch does not equal PMT_METADATA_KEYS_ONLY, then any aliases beginning with Capture will also be included.
Metadata instances are not actually returned by this method, rather an instance of PmtMetadataIterator is returned. This iterator contains pointers (i.e., PmtMetadataPtr) to the metadata instances that matched the supplied key. Pointers to PmtCompositeMetadata instances are not included in the returned iterator. Only the leaf metadata instances (i.e., those of type PmtMetadataT<>) are returned in the iterator.
If createMetadataIfNotExists is false, then the returned metadata items as described above may differ. The items returned will only be returned if they already exist. This means, for example, that if CaptureConditions.Aperture" is requested, and Aperture does not exist already, nothing will be returned in the PmtMetadataIterator. The same principle applies to all calls made to this method when createMetadataIfNotExists is false.
The entryToSearch parameter specifies if metadata keys, aliases, or both are searched for the creation / retrieval of metadata instances. PMT_ALL_KEYS, the default, means that if an alias file is loaded, then both regular metadata keys and aliases (including wildcards) will be searched. PMT_METADATA_KEYS_ONLY means that only metadata keys will be searched, whereas PMT_ALIAS_KEYS_ONLY means that only aliases will be searched.
Here is example code (assumes the default schema is loaded):
Reimplemented from PmtMetadata. |
PmtMetadataPtr PmtCompositeMetadata::getMetadatum |
( |
const PmtKeyType & |
key, |
|
|
bool |
createMetadataIfNotExists = true |
|
) |
[virtual] |
|
|
Returns an reference to a metadata instance whose key matched the specified key.
-
Parameters:
-
key |
is of type PmtKeyType and is the quialified key of the metadata instance to be retrieved |
createMetadataIfNotExists |
is of type bool and controls the behavior of the creation of non-existant metadata. Default is true - create if it does not exist. false will not create the instance and a NULL PmtMetadataPtr is returned. |
Reimplemented from PmtMetadata. |
virtual bool PmtCompositeMetadata::isComposite |
( |
|
) |
const [inline, virtual] |
|
|
Returns true if the metadata is a composite.
Reimplemented from PmtMetadata. |
const PmtModelGroupPtr& PmtCompositeMetadata::modelGroup |
( |
void |
|
) |
const [inline] |
|
PmtCompositeMetadata & PmtCompositeMetadata::operator= |
( |
const PmtCompositeMetadata & |
rhs |
) |
|
|
ostream & PmtCompositeMetadata::printDerived |
( |
ostream & |
c |
) |
const [virtual] |
|
|
DEPRECIATED - Write derived class values.
Implements PmtMetadata. |
void PmtCompositeMetadata::show |
( |
bool |
showObjectMemoryPointers = false, |
|
|
int |
level = 0, |
|
|
bool |
showModelGroups = false |
|
) |
[virtual] |
|
The documentation for this class was generated from the following files:
|