MAttributeSpec Class Reference

#include <MAttributeSpec.h>

Class Description

An attribute specification.

Class that encapsulates component/attribute information for generating selection items.

This class is used by MPxSurfaceShape::matchComponent for validating attributes specified as strings and converting that specification to a component object.

The attribute specification ".foo.bar[3].x" would be expressed like this (using a pseudo-structure description):

name = "foo"
dimension = 0
}
name = "bar"
dimension = 1
type = kInteger
isRange = false
isBounded = true
value = 3
}
}
name = "x"
dimension = 0
}
}
+ Examples:

Public Member Functions

 MAttributeSpec ()
 Constructor.
 
 MAttributeSpec (const char *name)
 Constructor. More...
 
 MAttributeSpec (const MString &name)
 Constructor. More...
 
 MAttributeSpec (const MAttributeSpec &other)
 Copy constructor. More...
 
 ~MAttributeSpec ()
 Destructor.
 
const MString name () const
 Returns the attribute name part of the specification. More...
 
int dimensions () const
 Returns the dimension of the attribute specification. More...
 
void setName (const MString &name)
 Set the attribute name part of the specification. More...
 
void setDimensions (int value)
 Set the dimension of the attribute specification. More...
 
MAttributeSpecoperator= (const MAttributeSpec &rhs)
 Assignment operator. More...
 
const MAttributeIndex operator[] (int index) const
 Returns an attribute index object for the specified element. More...
 
bool operator== (const MAttributeSpec &other) const
 Comparison operator. More...
 
MAttributeIndex operator[] (int index)
 This method is not available in Python. More...
 

Static Public Member Functions

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

Constructor & Destructor Documentation

MAttributeSpec ( const char *  name)

Constructor.

Creates an attribute specification with the given attribute name.

Parameters
[in]namethe attribute name to set
MAttributeSpec ( const MString name)

Constructor.

Creates an attribute specification with the given attribute name.

Parameters
[in]namethe attribute name to set
MAttributeSpec ( const MAttributeSpec other)

Copy constructor.

Parameters
[in]otherthe attribute specification to copy

Member Function Documentation

const MString name ( ) const

Returns the attribute name part of the specification.

Returns
The attribute name
+ Examples:
int dimensions ( ) const

Returns the dimension of the attribute specification.

For array attributes the dimension is > 0.

Returns
The attributes dimension
+ Examples:
void setName ( const MString name)

Set the attribute name part of the specification.

Parameters
[in]namethe name to be set
void setDimensions ( int  value)

Set the dimension of the attribute specification.

Array attribute dimensions are > 0.

Parameters
[in]valuethe dimension value to be set
MAttributeSpec & operator= ( const MAttributeSpec rhs)

Assignment operator.

Parameters
[in]rhsattribute specification to copy
Returns
A reference to the copied MAttributeSpec object.
const MAttributeIndex operator[] ( int  index) const

Returns an attribute index object for the specified element.

Parameters
[in]indexattribute index to return
Returns
The MAttributeIndex associated with the given index.
bool operator== ( const MAttributeSpec other) const

Comparison operator.

Parameters
[in]otherattribute specifier to be compared
Returns
The boolean indicating whether the object are same or not.
MAttributeIndex operator[] ( int  index)

This method is not available in Python.

Returns an attribute index object for the specified element.

Parameters
[in]indexattribute index to return
Returns
The MAttributeIndex associated with the given index.
const char * className ( )
static

Returns the name of this class.

Returns
The name of this class.

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