MUuid Class Reference

#include <MUuid.h>

Class Description

Class to manipulate UUIDs.

Provides a class to manipulate UUIDs (Universally Unique Identifiers).

UUIDs (as implemented here) are 128-bit values, used to identify objects 'practically' uniquely. Their main use in Maya is to identify DG nodes. Nodes have a UUID which persists even if the node's name is changed, or its DAG relationship alters, and which is stored in the Maya scene file.

See http://en.wikipedia.org/wiki/Universally_unique_identifier

Public Member Functions

 MUuid ()
 Class constructor. More...
 
 MUuid (const MUuid &other)
 Copy constructor. More...
 
 MUuid (const unsigned int *uuid)
 Constructor. More...
 
 MUuid (const unsigned char *uuid)
 Constructor. More...
 
 MUuid (const MString &value, MStatus *ReturnStatus=NULL)
 Constructor from string. More...
 
 ~MUuid ()
 Class destructor.
 
MUuidoperator= (const MUuid &rhs)
 Assignment operator. More...
 
bool operator== (const MUuid &rhs) const
 Equality operator. More...
 
bool operator!= (const MUuid &rhs) const
 Inequality operator. More...
 
MStatus get (unsigned char *uuid) const
 Gets the UUID as an array of sixteen bytes. More...
 
MString asString () const
 Gets the UUID as a string. More...
 
 operator MString () const
 Cast to string. More...
 
void copy (const MUuid &rhs)
 Copy method. More...
 
bool valid () const
 Queries whether the UUID is valid. More...
 
MStatus generate ()
 Generates a new random UUID and stores it in this class instance. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 

Constructor & Destructor Documentation

OPENMAYA_MAJOR_NAMESPACE_OPEN MUuid ( )

Class constructor.

Creates an empty MUuid object.

MUuid ( const MUuid other)

Copy constructor.

Creates a new MUuid object and initializes it with the value of another MUuid object.

Parameters
[in]otherThe MUuid to copy.
MUuid ( const unsigned int *  uuid)

Constructor.

Creates a new MUuid object and initializes it with the given UUID.

Parameters
[in]uuidThe UUID as an array of four 32 bit integers.
MUuid ( const unsigned char *  uuid)

Constructor.

Creates a new MUuid object and initializes it with the given UUID.

Parameters
[in]uuidThe UUID as an array of sixteen bytes.
MUuid ( const MString value,
MStatus ReturnStatus = NULL 
)

Constructor from string.

Creates a new MUuid object and initializes it with the value translated from the string representation of the UUID value.

This string should be of the form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX where 'X' is a hex digit. For example 3F2504E0-4F89-11D3-9A0C-0305E82C3301 So, the string is always exactly 36 characters long. See http://en.wikipedia.org/wiki/Universally_unique_identifier

Parameters
[in]valueThe value of the new object.
[out]ReturnStatusThe status code.
Status Codes:
  • MS::kSuccess operation successful
  • MS::kFailure invalid string

Member Function Documentation

MUuid & operator= ( const MUuid rhs)

Assignment operator.

Assigns the value of one MUuid to another.

Parameters
[in]rhsExisting MUuid object to copy.
Returns
Reference to this MUuid instance.
bool operator== ( const MUuid rhs) const

Equality operator.

Compares two MUuid objects to see if they contain the same value.

Parameters
[in]rhsRight operand.
Returns
true if the two objects are equivalent, false otherwise.
bool operator!= ( const MUuid rhs) const

Inequality operator.

Compares two MUuid objects to see if they differ.

Parameters
[in]rhsRight operand.
Returns
true if the two objects are different, false otherwise.
MStatus get ( unsigned char *  dest) const

Gets the UUID as an array of sixteen bytes.

Parameters
[out]destThe array to populate with the UUID value.
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MString asString ( ) const

Gets the UUID as a string.

Returns
The string representation of the UUID.
operator MString ( ) const

Cast to string.

Returns
The string representation of the UUID.
void copy ( const MUuid rhs)

Copy method.

Assigns the value of one MUuid to another.

Parameters
[in]rhsExisting MUuid object to copy.
bool valid ( ) const

Queries whether the UUID is valid.

Returns
true if the UUID is valid, false otherwise.
MStatus generate ( )

Generates a new random UUID and stores it in this class instance.

Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.

The documentation for this class was generated from the following files:
  • MUuid.h
  • MUuid.cpp