MDObject Class Reference

Metadata Object class. More...

#include <mdobject.h>

Inheritance diagram for MDObject:

RefCount IRefCount List of all members.

Public Types

typedef std::string(*) ULTranslator (ULPtr, const Tag *)
 Pointer to a translator function to translate unknown ULs to object names.

Public Member Functions

 MDObject (std::string BaseType, SymbolSpacePtr &SymSpace=MXFLibSymbols)
 Construct a new MDObject of the specified type.
 MDObject (MDOTypePtr BaseType)
 Construct a new MDObject of the specified type.
 MDObject (const UL &BaseUL)
 Construct a new MDObject of the type with the specified UL.
 MDObject (const ULPtr &BaseUL)
 Construct a new MDObject of the type with the specified UL.
 MDObject (Tag BaseTag, PrimerPtr BasePrimer)
 Construct a new MDObject of the type with the specified UL.
void Init (void)
 Generic constructor - called after each specific constructor has done its specific bits.
 ~MDObject ()
 Destroy an MDObject.
MDObjectPtr AddChild (std::string ChildName, bool Replace)
 Add a new child MDObject of the specified type.
MDObjectPtr AddChild (std::string ChildName, SymbolSpacePtr &SymSpace=MXFLibSymbols, bool Replace=true)
 Add a new child MDObject of the specified type.
MDObjectPtr AddChild (MDOTypePtr ChildType, bool Replace=true)
 Add a new child MDObject of the specified type.
MDObjectPtr AddChild (void)
 Add a new child MDObject to a vector.
MDObjectPtr AddChild (const UL &ChildType, bool Replace=true)
 Add a new child MDObject of the specified type.
MDObjectPtr AddChild (ULPtr &ChildType, bool Replace=true)
 Add a new child MDObject of the specified type.
MDObjectPtr AddChild (MDObjectPtr &ChildObject, bool Replace=false)
 Add a new child MDObject of the specified type.
void RemoveChild (std::string ChildName)
 Remove the (first) child of the specified type.
void RemoveChild (MDOTypePtr &ChildType)
 Remove the (first) child of the specified type.
void RemoveChild (ULPtr &ChildType)
 Remove the (first) child of the specified type.
void RemoveChild (MDObjectPtr ChildObject)
 Remove the specified child.
MDObjectPtr operator[] (std::string ChildName)
 Access function for child values of compound items.
MDObjectPtr Child (std::string ChildName)
MDObjectListPtr ChildList (std::string ChildName)
 Find all sub-items within a compound MDObject of a named type.
MDObjectListPtr ChildList (const UL &ChildType)
 Find all sub-items within a compound MDObject of a specified type.
MDObjectListPtr ChildList (const ULPtr &ChildType)
MDObjectPtr operator[] (MDOTypePtr ChildType)
 Access sub-item of the specified type within a compound MDObject.
MDObjectPtr Child (MDOTypePtr ChildType)
MDObjectListPtr ChildList (MDOTypePtr ChildType)
 Find all sub-items within a compound MDObject of a named type.
MDObjectPtr operator[] (const UL &ChildType)
 Access sub-item of the specified type within a compound MDObject.
MDObjectPtr operator[] (ULPtr &ChildType)
MDObjectPtr Child (const UL &ChildType)
MDObjectPtr Child (ULPtr &ChildType)
MDObjectListPtr ChildList (ULPtr &ChildType)
void SetInt (Int32 Val)
void SetInt64 (Int64 Val)
void SetUInt (UInt32 Val)
void SetUInt64 (UInt64 Val)
void SetUint (UInt32 Val)
void SetUint64 (UInt64 Val)
void SetString (std::string Val)
bool SetDValue (void)
 Set an object to its distinguished value.
void SetValue (const DataChunk &Source)
void SetValue (MDObjectPtr Source)
Int32 GetInt (Int32 Default=0)
Int64 GetInt64 (Int64 Default=0)
UInt32 GetUInt (UInt32 Default=0)
UInt64 GetUInt64 (UInt64 Default=0)
UInt32 GetUint (UInt32 Default=0)
UInt64 GetUint64 (UInt64 Default=0)
std::string GetString (std::string Default="")
bool IsDValue (void)
 Is an object set to its distinguished value?
bool SetDefault (void)
 Set the default value for this object.
void SetInt (const char *ChildName, Int32 Val)
void SetInt64 (const char *ChildName, Int64 Val)
void SetUInt (const char *ChildName, UInt32 Val)
void SetUInt64 (const char *ChildName, UInt64 Val)
void SetUint (const char *ChildName, UInt32 Val)
void SetUint64 (const char *ChildName, UInt64 Val)
void SetString (const char *ChildName, std::string Val)
bool SetDValue (const char *ChildName)
void SetValue (const char *ChildName, const DataChunk &Source)
void SetValue (const char *ChildName, MDObjectPtr Source)
Int32 GetInt (const char *ChildName, Int32 Default=0)
Int64 GetInt64 (const char *ChildName, Int64 Default=0)
UInt32 GetUInt (const char *ChildName, UInt32 Default=0)
UInt64 GetUInt64 (const char *ChildName, UInt64 Default=0)
UInt32 GetUint (const char *ChildName, UInt32 Default=0)
UInt64 GetUint64 (const char *ChildName, UInt64 Default=0)
std::string GetString (const char *ChildName, std::string Default="")
bool IsDValue (const char *ChildName)
void SetInt (const UL &ChildType, Int32 Val)
void SetInt (ULPtr &ChildType, Int32 Val)
void SetInt64 (const UL &ChildType, Int64 Val)
void SetInt64 (ULPtr &ChildType, Int64 Val)
void SetUInt (const UL &ChildType, UInt32 Val)
void SetUInt (ULPtr &ChildType, UInt32 Val)
void SetUInt64 (const UL &ChildType, UInt64 Val)
void SetUInt64 (ULPtr &ChildType, UInt64 Val)
void SetString (const UL &ChildType, std::string Val)
void SetString (ULPtr &ChildType, std::string Val)
bool SetDValue (const UL &ChildType)
bool SetDValue (ULPtr &ChildType)
void SetValue (const UL &ChildType, const DataChunk &Source)
void SetValue (ULPtr &ChildType, const DataChunk &Source)
void SetValue (const UL &ChildType, MDObjectPtr Source)
void SetValue (ULPtr &ChildType, MDObjectPtr Source)
Int32 GetInt (const UL &ChildType, Int32 Default=0)
Int32 GetInt (ULPtr &ChildType, Int32 Default=0)
Int64 GetInt64 (const UL &ChildType, Int64 Default=0)
Int64 GetInt64 (ULPtr &ChildType, Int64 Default=0)
UInt32 GetUInt (const UL &ChildType, UInt32 Default=0)
UInt32 GetUInt (ULPtr &ChildType, UInt32 Default=0)
UInt64 GetUInt64 (const UL &ChildType, UInt64 Default=0)
UInt64 GetUInt64 (ULPtr &ChildType, UInt64 Default=0)
std::string GetString (const UL &ChildType, std::string Default="")
std::string GetString (ULPtr &ChildType, std::string Default="")
bool IsDValue (const UL &ChildType)
bool IsDValue (ULPtr &ChildType)
void SetInt (MDOTypePtr ChildType, Int32 Val)
void SetInt64 (MDOTypePtr ChildType, Int64 Val)
void SetUInt (MDOTypePtr ChildType, UInt32 Val)
void SetUInt64 (MDOTypePtr ChildType, UInt64 Val)
void SetUint (MDOTypePtr ChildType, UInt32 Val)
void SetUint64 (MDOTypePtr ChildType, UInt64 Val)
void SetString (MDOTypePtr ChildType, std::string Val)
bool SetDValue (MDOTypePtr ChildType)
void SetValue (MDOTypePtr ChildType, MDObjectPtr Source)
void SetValue (MDOTypePtr ChildType, const DataChunk &Source)
Int32 GetInt (MDOTypePtr ChildType, Int32 Default=0)
Int64 GetInt64 (MDOTypePtr ChildType, Int64 Default=0)
UInt32 GetUInt (MDOTypePtr ChildType, UInt32 Default=0)
UInt64 GetUInt64 (MDOTypePtr ChildType, UInt64 Default=0)
UInt32 GetUint (MDOTypePtr ChildType, UInt32 Default=0)
UInt64 GetUint64 (MDOTypePtr ChildType, UInt64 Default=0)
std::string GetString (MDOTypePtr ChildType, std::string Default="")
bool IsDValue (MDOTypePtr ChildType)
const DataChunkGetData (void)
 Get a reference to the data chunk (const to prevent setting!!).
const DataChunkPtr PutData (PrimerPtr UsePrimer=NULL)
 Build a data chunk with all this item's data (including child data).
size_t ReadValue (const DataChunk &Chunk)
 Read the object's value from a data chunk.
size_t ReadValue (DataChunkPtr &Chunk)
 Read the object's value from a data chunk pointer.
size_t ReadValue (const UInt8 *Buffer, size_t Size, PrimerPtr UsePrimer=NULL)
 Read the object's value from a memory buffer.
DataChunkPtr WriteObject (MDObjectPtr ParentObject, PrimerPtr UsePrimer, UInt32 BERSize=0)
 Write this object to a new memory buffer.
size_t WriteObject (DataChunkPtr &Buffer, MDObjectPtr ParentObject, PrimerPtr UsePrimer, UInt32 BERSize=0)
 Write this object to a memory buffer.
DataChunkPtr WriteObject (PrimerPtr UsePrimer=NULL, UInt32 BERSize=0)
 Write this top level object to a new memory buffer.
size_t WriteObject (DataChunkPtr &Buffer, PrimerPtr UsePrimer=NULL, UInt32 BERSize=0)
 Write this top level object to a memory buffer.
size_t WriteLinkedObjects (DataChunkPtr &Buffer, PrimerPtr UsePrimer=NULL)
 Write this object, and any strongly linked sub-objects, to a memory buffer.
std::string Name (void) const
 Report the name of this item (the name of its type).
std::string FullName (void) const
 Report the full name of this item (the full name of its type).
void insert (MDObjectPtr NewObject)
 Inset a new child object - overloads the existing MDObjectList version.
const MDOTypePtrGetType (void) const
 Type access function.
bool IsA (std::string BaseType)
 Determine if this object is derived from a specified type (directly or indirectly).
bool IsA (MDOTypePtr &BaseType)
 Determine if this object is derived from a specified type (directly or indirectly).
bool IsA (const UL &BaseType)
 Determine if this object is derived from a specified type (directly or indirectly).
bool IsA (ULPtr &BaseType)
 Determine if this object is derived from a specified type (directly or indirectly).
MDObjectPtr GetLink (void) const
 Link access functions.
bool MakeRef (MDObjectPtr &TargetSet, bool ForceLink=false)
 Make a link from this reference source to the specified target set.
bool MakeLink (MDObjectPtr &TargetSet, bool ForceLink=false)
 DEPRECATED: Make a link from this reference source to the specified target set.
void SetLink (MDObjectPtr NewLink)
 Record that a link exists (not the same as making a link - see MakeRef).
ClassRef GetRefType (void) const
 Ref access function.
MDOTypePtr GetRefTarget (void) const
 Accessor for Reference Target.
void SetParent (MXFFilePtr &File, UInt64 Location, UInt32 NewKLSize)
 Set the parent details when an object has been read from a file.
void SetParent (MDObjectPtr &Object, UInt64 Location, UInt32 NewKLSize)
 Set the parent details when an object has been read from memory.
MDObjectParentGetParent (void)
 Access function for Parent.
MXFFilePtrGetParentFile (void)
 Access function for ParentFile.
const ULPtrGetUL (void)
 Get the object's UL.
void SetUL (ULPtr &NewUL)
 Set the object's UL.
void SetTag (Tag NewTag)
 Set the object's tag.
Tag GetTag (void)
 Get the object's tag.
bool ChangeType (const UL &NewType)
 Change the type of an MDObject.
bool ChangeType (ULPtr &NewType)
 Change the type of an MDObject.
bool ChangeType (std::string NewType)
 Change the type of an MDObject.
MDObjectPtr MakeCopy (void)
 Make a copy of this object.
bool SetGenerationUID (UUIDPtr UID)
 Set the GenerationUID of an object iff it has been modified.
bool IsModified (void)
 Has this object (including any child objects) been modified?
void ClearModified (void)
 Clear the modified flag on this object and any contained objects.
UInt64 GetLocation (void)
 Get the location within the ultimate parent.
std::string GetSource (void)
 Get text that describes where this item came from.
std::string GetSourceLocation (void)
 Get text that describes exactly where this item came from.
ObjectInterfaceGetOuter (void)
 Get pointer to Outer object.
void SetOuter (ObjectInterface *NewOuter)
 Set pointer to Outer object.

Static Public Member Functions

static void SetULTranslator (ULTranslator Trans)
 Set a translator function to translate unknown ULs to object names.
static void SetParseDark (bool Value)
 Set the "attempt to parse dark metadata" flag.

Public Attributes

MDValuePtr Value

Protected Member Functions

void ULCtor (void)
 MDObject UL based constructor body.
MDObjectPtr AddChildInternal (MDObjectPtr ChildObject, bool Replace=false)
 Add a new child MDObject of the specified type.
void SetModified (bool State)
 Sets the modification state of this object.
UInt32 WriteKey (DataChunkPtr &Buffer, DictKeyFormat Format, PrimerPtr UsePrimer=NULL)
 Write an objects key.

Static Protected Member Functions

static UInt32 ReadKey (DictKeyFormat Format, size_t Size, const UInt8 *Buffer, DataChunk &Key)
 Read a key from a memory buffer.
static UInt32 ReadLength (DictLenFormat Format, size_t Size, const UInt8 *Buffer, Length &Length)
 Read a length field from a memory buffer.
static UInt32 WriteLength (DataChunkPtr &Buffer, Length Length, DictLenFormat Format, UInt32 Size=0)
 Write a length field to a memory buffer.

Protected Attributes

MDOTypePtr Type
MDObjectPtr Link
bool IsConstructed
 True if this object is constructed, false if read from a file or a parent object.
UInt64 ParentOffset
 Offset from start of parent object if read from file or object.
UInt32 KLSize
 Size of this objects KL if read from file or parent object.
MDObjectParent Parent
 Pointer to parent if read from inside another object.
MXFFileParent ParentFile
 Pointer to parent file if read from a file.
ULPtr TheUL
 The UL for this object (if known).
Tag TheTag
 The local tag used for this object (if known).
std::string ObjectName
 The name of this object (normally the name of the type).
bool Modified
 True if this object has been modified since being "read".
ObjectInterfaceOuter
 Pointer to outer object if this is a sub-object of an ObjectInterface derived object.

Static Protected Attributes

static ULTranslator UL2NameFunc
 Translator function to translate unknown ULs to object names.
static bool ParseDark
 Static flag to say if dark metadata sets that appear to be valid KLV 2x2 sets should be parsed.

Detailed Description

Metadata Object class.


Member Typedef Documentation

typedef std::string(*) ULTranslator(ULPtr, const Tag *)

Pointer to a translator function to translate unknown ULs to object names.


Constructor & Destructor Documentation

MDObject ( std::string  BaseType,
SymbolSpacePtr SymSpace = MXFLibSymbols 
)

Construct a new MDObject of the specified type.

BaseType is a symbol to be located in the given SymbolSpace - if no SymbolSpace is specifed the default MXFLib space is used

MDObject ( MDOTypePtr  BaseType  ) 

Construct a new MDObject of the specified type.

Builds a "blank" metadata object of a specified type

Note:
packs are built with defaut values

MDObject ( const UL BaseUL  )  [inline]

Construct a new MDObject of the type with the specified UL.

MDObject ( const ULPtr BaseUL  )  [inline]

Construct a new MDObject of the type with the specified UL.

MDObject ( Tag  BaseTag,
PrimerPtr  BasePrimer 
)

Construct a new MDObject of the type with the specified UL.

Builds a "blank" metadata object of a specified type

Note:
packs are built with defaut values

~MDObject (  ) 

Destroy an MDObject.

Frees the data of the object if it exists


Member Function Documentation

void ULCtor ( void   )  [protected]

MDObject UL based constructor body.

Builds a "blank" metadata object of a specified type

Note:
packs are built with default values

TheUL must be set before calling

void Init ( void   ) 

Generic constructor - called after each specific constructor has done its specific bits.

Builds a "blank" metadata object

Note:
packs are built with defaut values

MDObjectPtr AddChild ( std::string  ChildName,
bool  Replace 
) [inline]

Add a new child MDObject of the specified type.

ChildName is a symbol to be located in default MXFLib SymbolSpace

MDObjectPtr AddChild ( std::string  ChildName,
SymbolSpacePtr SymSpace = MXFLibSymbols,
bool  Replace = true 
)

Add a new child MDObject of the specified type.

ChildName is a symbol to be located in the given SymbolSpace - if no SymbolSpace is specifed the default MXFLib space is used

MDObjectPtr AddChild ( MDOTypePtr  ChildType,
bool  Replace = true 
)

Add a new child MDObject of the specified type.

If Replace is true (or not supplied) and a child of this type already exists a pointer to that child is returned but the value is not changed.

Returns:
NULL if it is not a valid child to add to this type of container
Note:
If you want to add an child that is non-standard (i.e. not listed as a child in the container's MDOType then you must build the child then add it with AddChild(MDObjectPtr)

MDObjectPtr AddChild ( void   ) 

Add a new child MDObject to a vector.

Note:
The type of the object added is automatic. If the vector is of multiple members the next type will be chosen by the number of members currently in the array, so if there are 3 sub member types the 7th entry will be type 1 [ 7 = (2*3) + 1 ]

This version of AddChild will not replace duplicates, it always appends

MDObjectPtr AddChild ( const UL ChildType,
bool  Replace = true 
)

Add a new child MDObject of the specified type.

DRAGONS: This code searches for child entries that match rather than simply doing a full UL-lookup as there may be cases where the same UL is used somewhere else but is not compatible (such as in a pack definition whereas are adding to a local set to need a valid local tag)

MDObjectPtr AddChild ( ULPtr ChildType,
bool  Replace = true 
) [inline]

Add a new child MDObject of the specified type.

MDObjectPtr AddChild ( MDObjectPtr ChildObject,
bool  Replace = false 
)

Add a new child MDObject of the specified type.

Returns:
pointer to the object added (for compatibility with other ADDChild funcs)

NULL if there was an error

Note:
If there is already a child of this type it is replaces if Replace = true

MDObjectPtr AddChildInternal ( MDObjectPtr  ChildObject,
bool  Replace = false 
) [protected]

Add a new child MDObject of the specified type.

Same as AddChild(), but does not set "Modified"

void RemoveChild ( std::string  ChildName  ) 

Remove the (first) child of the specified type.

void RemoveChild ( MDOTypePtr ChildType  ) 

Remove the (first) child of the specified type.

void RemoveChild ( ULPtr ChildType  ) 

Remove the (first) child of the specified type.

void RemoveChild ( MDObjectPtr  ChildObject  ) 

Remove the specified child.

If the object is not an child of the container nothing is done

MDObjectPtr operator[] ( std::string  ChildName  ) 

Access function for child values of compound items.

If the child does not exist in this item then NULL is returned even if it is a valid child to have in this type of container

DRAGONS: This doesn't work well with SmartPtrs so member function Child() is also available

MDObjectPtr Child ( std::string  ChildName  )  [inline]

MDObjectListPtr ChildList ( std::string  ChildName  ) 

Find all sub-items within a compound MDObject of a named type.

MDObjectListPtr ChildList ( const UL ChildType  ) 

Find all sub-items within a compound MDObject of a specified type.

MDObjectListPtr ChildList ( const ULPtr ChildType  )  [inline]

MDObjectPtr operator[] ( MDOTypePtr  ChildType  ) 

Access sub-item of the specified type within a compound MDObject.

If the child does not exist in this item then NULL is returned even if it is a valid child to have in this type of container

DRAGONS: This doesn't work well with SmartPtrs so member function Child() is also available

MDObjectPtr Child ( MDOTypePtr  ChildType  )  [inline]

MDObjectListPtr ChildList ( MDOTypePtr  ChildType  ) 

Find all sub-items within a compound MDObject of a named type.

MDObjectPtr operator[] ( const UL ChildType  ) 

Access sub-item of the specified type within a compound MDObject.

If the child does not exist in this item then NULL is returned even if it is a valid child to have in this type of container

DRAGONS: This doesn't work well with SmartPtrs so member function Child() is also available

MDObjectPtr operator[] ( ULPtr ChildType  )  [inline]

MDObjectPtr Child ( const UL ChildType  )  [inline]

MDObjectPtr Child ( ULPtr ChildType  )  [inline]

MDObjectListPtr ChildList ( ULPtr ChildType  ) 

void SetInt ( Int32  Val  )  [inline]

void SetInt64 ( Int64  Val  )  [inline]

void SetUInt ( UInt32  Val  )  [inline]

void SetUInt64 ( UInt64  Val  )  [inline]

void SetUint ( UInt32  Val  )  [inline]

void SetUint64 ( UInt64  Val  )  [inline]

void SetString ( std::string  Val  )  [inline]

bool SetDValue ( void   ) 

Set an object to its distinguished value.

Returns:
true if distinguished value set, else false

void SetValue ( const DataChunk Source  )  [inline]

void SetValue ( MDObjectPtr  Source  )  [inline]

Int32 GetInt ( Int32  Default = 0  )  [inline]

Int64 GetInt64 ( Int64  Default = 0  )  [inline]

UInt32 GetUInt ( UInt32  Default = 0  )  [inline]

UInt64 GetUInt64 ( UInt64  Default = 0  )  [inline]

UInt32 GetUint ( UInt32  Default = 0  )  [inline]

UInt64 GetUint64 ( UInt64  Default = 0  )  [inline]

std::string GetString ( std::string  Default = ""  )  [inline]

bool IsDValue ( void   ) 

Is an object set to its distinguished value?

Returns:
true if distinguished value set, else false

bool SetDefault ( void   )  [inline]

Set the default value for this object.

Returns:
true is a default value is set, else false

void SetInt ( const char *  ChildName,
Int32  Val 
) [inline]

void SetInt64 ( const char *  ChildName,
Int64  Val 
) [inline]

void SetUInt ( const char *  ChildName,
UInt32  Val 
) [inline]

void SetUInt64 ( const char *  ChildName,
UInt64  Val 
) [inline]

void SetUint ( const char *  ChildName,
UInt32  Val 
) [inline]

void SetUint64 ( const char *  ChildName,
UInt64  Val 
) [inline]

void SetString ( const char *  ChildName,
std::string  Val 
) [inline]

bool SetDValue ( const char *  ChildName  )  [inline]

void SetValue ( const char *  ChildName,
const DataChunk Source 
) [inline]

void SetValue ( const char *  ChildName,
MDObjectPtr  Source 
) [inline]

Int32 GetInt ( const char *  ChildName,
Int32  Default = 0 
) [inline]

Int64 GetInt64 ( const char *  ChildName,
Int64  Default = 0 
) [inline]

UInt32 GetUInt ( const char *  ChildName,
UInt32  Default = 0 
) [inline]

UInt64 GetUInt64 ( const char *  ChildName,
UInt64  Default = 0 
) [inline]

UInt32 GetUint ( const char *  ChildName,
UInt32  Default = 0 
) [inline]

UInt64 GetUint64 ( const char *  ChildName,
UInt64  Default = 0 
) [inline]

std::string GetString ( const char *  ChildName,
std::string  Default = "" 
) [inline]

bool IsDValue ( const char *  ChildName  )  [inline]

void SetInt ( const UL ChildType,
Int32  Val 
) [inline]

void SetInt ( ULPtr ChildType,
Int32  Val 
) [inline]

void SetInt64 ( const UL ChildType,
Int64  Val 
) [inline]

void SetInt64 ( ULPtr ChildType,
Int64  Val 
) [inline]

void SetUInt ( const UL ChildType,
UInt32  Val 
) [inline]

void SetUInt ( ULPtr ChildType,
UInt32  Val 
) [inline]

void SetUInt64 ( const UL ChildType,
UInt64  Val 
) [inline]

void SetUInt64 ( ULPtr ChildType,
UInt64  Val 
) [inline]

void SetString ( const UL ChildType,
std::string  Val 
) [inline]

void SetString ( ULPtr ChildType,
std::string  Val 
) [inline]

bool SetDValue ( const UL ChildType  )  [inline]

bool SetDValue ( ULPtr ChildType  )  [inline]

void SetValue ( const UL ChildType,
const DataChunk Source 
) [inline]

void SetValue ( ULPtr ChildType,
const DataChunk Source 
) [inline]

void SetValue ( const UL ChildType,
MDObjectPtr  Source 
) [inline]

void SetValue ( ULPtr ChildType,
MDObjectPtr  Source 
) [inline]

Int32 GetInt ( const UL ChildType,
Int32  Default = 0 
) [inline]

Int32 GetInt ( ULPtr ChildType,
Int32  Default = 0 
) [inline]

Int64 GetInt64 ( const UL ChildType,
Int64  Default = 0 
) [inline]

Int64 GetInt64 ( ULPtr ChildType,
Int64  Default = 0 
) [inline]

UInt32 GetUInt ( const UL ChildType,
UInt32  Default = 0 
) [inline]

UInt32 GetUInt ( ULPtr ChildType,
UInt32  Default = 0 
) [inline]

UInt64 GetUInt64 ( const UL ChildType,
UInt64  Default = 0 
) [inline]

UInt64 GetUInt64 ( ULPtr ChildType,
UInt64  Default = 0 
) [inline]

std::string GetString ( const UL ChildType,
std::string  Default = "" 
) [inline]

std::string GetString ( ULPtr ChildType,
std::string  Default = "" 
) [inline]

bool IsDValue ( const UL ChildType  )  [inline]

bool IsDValue ( ULPtr ChildType  )  [inline]

void SetInt ( MDOTypePtr  ChildType,
Int32  Val 
) [inline]

void SetInt64 ( MDOTypePtr  ChildType,
Int64  Val 
) [inline]

void SetUInt ( MDOTypePtr  ChildType,
UInt32  Val 
) [inline]

void SetUInt64 ( MDOTypePtr  ChildType,
UInt64  Val 
) [inline]

void SetUint ( MDOTypePtr  ChildType,
UInt32  Val 
) [inline]

void SetUint64 ( MDOTypePtr  ChildType,
UInt64  Val 
) [inline]

void SetString ( MDOTypePtr  ChildType,
std::string  Val 
) [inline]

bool SetDValue ( MDOTypePtr  ChildType  )  [inline]

void SetValue ( MDOTypePtr  ChildType,
MDObjectPtr  Source 
) [inline]

void SetValue ( MDOTypePtr  ChildType,
const DataChunk Source 
) [inline]

Int32 GetInt ( MDOTypePtr  ChildType,
Int32  Default = 0 
) [inline]

Int64 GetInt64 ( MDOTypePtr  ChildType,
Int64  Default = 0 
) [inline]

UInt32 GetUInt ( MDOTypePtr  ChildType,
UInt32  Default = 0 
) [inline]

UInt64 GetUInt64 ( MDOTypePtr  ChildType,
UInt64  Default = 0 
) [inline]

UInt32 GetUint ( MDOTypePtr  ChildType,
UInt32  Default = 0 
) [inline]

UInt64 GetUint64 ( MDOTypePtr  ChildType,
UInt64  Default = 0 
) [inline]

std::string GetString ( MDOTypePtr  ChildType,
std::string  Default = "" 
) [inline]

bool IsDValue ( MDOTypePtr  ChildType  )  [inline]

const DataChunk& GetData ( void   )  [inline]

Get a reference to the data chunk (const to prevent setting!!).

const DataChunkPtr PutData ( PrimerPtr  UsePrimer = NULL  ) 

Build a data chunk with all this item's data (including child data).

size_t ReadValue ( const DataChunk Chunk  )  [inline]

Read the object's value from a data chunk.

size_t ReadValue ( DataChunkPtr Chunk  )  [inline]

Read the object's value from a data chunk pointer.

size_t ReadValue ( const UInt8 Buffer,
size_t  Size,
PrimerPtr  UsePrimer = NULL 
)

Read the object's value from a memory buffer.

Note that collection headers are handled here rather than in the MDValue because MDValue objects don't differentiate. A primer must be supplied for reading sets

DRAGONS: This function is bloated and should be split up

Returns:
Number of bytes read

DataChunkPtr WriteObject ( MDObjectPtr  ParentObject,
PrimerPtr  UsePrimer,
UInt32  BERSize = 0 
) [inline]

Write this object to a new memory buffer.

size_t WriteObject ( DataChunkPtr Buffer,
MDObjectPtr  ParentObject,
PrimerPtr  UsePrimer,
UInt32  BERSize = 0 
)

Write this object to a memory buffer.

DataChunkPtr WriteObject ( PrimerPtr  UsePrimer = NULL,
UInt32  BERSize = 0 
) [inline]

Write this top level object to a new memory buffer.

The object must be at the outer or top KLV level

Returns:
The new buffer

size_t WriteObject ( DataChunkPtr Buffer,
PrimerPtr  UsePrimer = NULL,
UInt32  BERSize = 0 
) [inline]

Write this top level object to a memory buffer.

The object must be at the outer or top KLV level. The object is appended to the buffer

Returns:
The number of bytes written

size_t WriteLinkedObjects ( DataChunkPtr Buffer,
PrimerPtr  UsePrimer = NULL 
)

Write this object, and any strongly linked sub-objects, to a memory buffer.

The object must be at the outer or top KLV level. The objects are appended to the buffer

Returns:
The number of bytes written

std::string Name ( void   )  const [inline]

Report the name of this item (the name of its type).

std::string FullName ( void   )  const [inline]

Report the full name of this item (the full name of its type).

void insert ( MDObjectPtr  NewObject  )  [inline]

Inset a new child object - overloads the existing MDObjectList version.

const MDOTypePtr& GetType ( void   )  const [inline]

Type access function.

bool IsA ( std::string  BaseType  ) 

Determine if this object is derived from a specified type (directly or indirectly).

bool IsA ( MDOTypePtr BaseType  ) 

Determine if this object is derived from a specified type (directly or indirectly).

bool IsA ( const UL BaseType  ) 

Determine if this object is derived from a specified type (directly or indirectly).

bool IsA ( ULPtr BaseType  )  [inline]

Determine if this object is derived from a specified type (directly or indirectly).

MDObjectPtr GetLink ( void   )  const [inline]

Link access functions.

bool MakeRef ( MDObjectPtr TargetSet,
bool  ForceLink = false 
)

Make a link from this reference source to the specified target set.

If the target set already has an instanceUID it will be used, otherwise one will be added.

Parameters:
TargetSet A pointer to the set to be the target of this reference
ForceLink True if the link is to be made even if not a valid reference source/target pair
Returns:
true on success, else false
Note:
The link will be made from the source property to the target set so be aware that "this" must be a reference source property and "TargetSet" must be a set (or pack) containing an InstanceUID property which is a reference target

bool MakeLink ( MDObjectPtr TargetSet,
bool  ForceLink = false 
) [inline]

DEPRECATED: Make a link from this reference source to the specified target set.

Note:
This method is deprecated - use MakeRef() instead

void SetLink ( MDObjectPtr  NewLink  )  [inline]

Record that a link exists (not the same as making a link - see MakeRef).

ClassRef GetRefType ( void   )  const [inline]

Ref access function.

MDOTypePtr GetRefTarget ( void   )  const [inline]

Accessor for Reference Target.

void SetParent ( MXFFilePtr File,
UInt64  Location,
UInt32  NewKLSize 
) [inline]

Set the parent details when an object has been read from a file.

void SetParent ( MDObjectPtr Object,
UInt64  Location,
UInt32  NewKLSize 
) [inline]

Set the parent details when an object has been read from memory.

MDObjectParent& GetParent ( void   )  [inline]

Access function for Parent.

MXFFilePtr& GetParentFile ( void   )  [inline]

Access function for ParentFile.

const ULPtr& GetUL ( void   )  [inline]

Get the object's UL.

void SetUL ( ULPtr NewUL  )  [inline]

Set the object's UL.

void SetTag ( Tag  NewTag  )  [inline]

Set the object's tag.

Tag GetTag ( void   )  [inline]

Get the object's tag.

bool ChangeType ( const UL NewType  )  [inline]

Change the type of an MDObject.

Note:
This may result in very wrong data - exercise great care!

bool ChangeType ( ULPtr NewType  )  [inline]

Change the type of an MDObject.

Note:
This may result in very wrong data - exercise great care!

bool ChangeType ( std::string  NewType  )  [inline]

Change the type of an MDObject.

Note:
This may result in very wrong data - exercise great care!

MDObjectPtr MakeCopy ( void   ) 

Make a copy of this object.

void SetModified ( bool  State  )  [inline, protected]

Sets the modification state of this object.

Note:
This function should be used rather than setting "Modified" as a future revision may "bubble" this up from sub-items to sets and packs

bool SetGenerationUID ( UUIDPtr  UID  ) 

Set the GenerationUID of an object iff it has been modified.

Returns:
true if the GenerationUID has been set, otherwise false
Note:
If the object does not have a GenerationUID property false is returned!

bool IsModified ( void   ) 

Has this object (including any child objects) been modified?

void ClearModified ( void   ) 

Clear the modified flag on this object and any contained objects.

UInt64 GetLocation ( void   ) 

Get the location within the ultimate parent.

std::string GetSource ( void   ) 

Get text that describes where this item came from.

std::string GetSourceLocation ( void   )  [inline]

Get text that describes exactly where this item came from.

ObjectInterface* GetOuter ( void   )  [inline]

Get pointer to Outer object.

void SetOuter ( ObjectInterface NewOuter  )  [inline]

Set pointer to Outer object.

static void SetULTranslator ( ULTranslator  Trans  )  [inline, static]

Set a translator function to translate unknown ULs to object names.

static void SetParseDark ( bool  Value  )  [inline, static]

Set the "attempt to parse dark metadata" flag.

UInt32 ReadKey ( DictKeyFormat  Format,
size_t  Size,
const UInt8 Buffer,
DataChunk Key 
) [static, protected]

Read a key from a memory buffer.

UInt32 ReadLength ( DictLenFormat  Format,
size_t  Size,
const UInt8 Buffer,
Length Length 
) [static, protected]

Read a length field from a memory buffer.

UInt32 WriteKey ( DataChunkPtr Buffer,
DictKeyFormat  Format,
PrimerPtr  UsePrimer = NULL 
) [protected]

Write an objects key.

The key is appended to the specified buffer

Returns:
Number of bytes written
Note:
If the object has no parent the full UL will be written, otherwise the parent will be examined to determine the type of key to write.

If a 2-byte local tag is used the primer UsePrimer is used to determine the correct tag. UsePrimer will be updated if it doesn't yet incude the tag

UInt32 WriteLength ( DataChunkPtr Buffer,
Length  Length,
DictLenFormat  Format,
UInt32  Size = 0 
) [static, protected]

Write a length field to a memory buffer.

The length is appended to the specified buffer

Parameters:
Buffer The buffer to receive the length
Length The length to be written
Format The format to use for the length
Size The total number of bytes to write for a BER length (or 0 for auto)
Returns:
Number of bytes written
Note:
If the format is BER and a size is specified it will be overridden for lengths that will not fit. However an error message will be produced.


Member Data Documentation

MDOTypePtr Type [protected]

MDObjectPtr Link [protected]

bool IsConstructed [protected]

True if this object is constructed, false if read from a file or a parent object.

UInt64 ParentOffset [protected]

Offset from start of parent object if read from file or object.

UInt32 KLSize [protected]

Size of this objects KL if read from file or parent object.

MDObjectParent Parent [protected]

Pointer to parent if read from inside another object.

MXFFileParent ParentFile [protected]

Pointer to parent file if read from a file.

ULPtr TheUL [protected]

The UL for this object (if known).

Tag TheTag [protected]

The local tag used for this object (if known).

std::string ObjectName [protected]

The name of this object (normally the name of the type).

bool Modified [protected]

True if this object has been modified since being "read".

This is used to automatically update the GenerationUID when writing the object

ObjectInterface* Outer [protected]

Pointer to outer object if this is a sub-object of an ObjectInterface derived object.

MDObject::ULTranslator UL2NameFunc [static, protected]

Translator function to translate unknown ULs to object names.

bool ParseDark [static, protected]

Static flag to say if dark metadata sets that appear to be valid KLV 2x2 sets should be parsed.

MDValuePtr Value


The documentation for this class was generated from the following files:
Generated on Mon Apr 2 15:21:00 2007 for MXFLib by  doxygen 1.5.1-p1