- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# MAttributeSpecArray Class Reference
OpenMaya - API module for common classes

Search for all occurrences

## Detailed Description

An attribute specification array.

Array class for MAttributeSpec.

See MAttributeSpec for more information.

Examples:

  apiMeshShape.cpp, and apiMeshShape.h.

`#include <MAttributeSpecArray.h>`

List of all members.

## Public Member Functions
| MAttributeSpecArray ()
| Default constructor.
| MAttributeSpecArray (const MAttributeSpecArray &other)
| Copy Constructor.
| MAttributeSpecArray (unsigned int initializeSize, const MAttributeSpec &initialValue)
| Create a new array of MAttributeSpecs of a specified size and initialize all the elements with the given initial value.
| ~MAttributeSpecArray ()
| Class Destructor.
MAttributeSpec | operator[] (unsigned int index) const
| Index operator.
MAttributeSpecArray & | operator= (const MAttributeSpecArray &other)
| Assignment operator.
MStatus | set (const MAttributeSpec &element, unsigned int index)
| Sets the value of the specified element to the given attribute spec.
MStatus | setLength (unsigned int length)
| Set the length of the array.
unsigned int | length () const
| Returns the number of elements in the array.
MStatus | remove (unsigned int index)
| Removes the element in the array at the given index.
MStatus | insert (const MAttributeSpec &element, unsigned int index)
| Inserts a new value into the array at the given index.
MStatus | append (const MAttributeSpec &element)
| Adds a new element to the end of the array.
MStatus | copy (const MAttributeSpecArray &source)
| Copy the contents of the source array to this array.
MStatus | clear ()
| Clear the contents of the array.
void | setSizeIncrement (unsigned int newIncrement)
| Set the size by which the array will be expanded whenever expansion is necessary.
unsigned int | sizeIncrement () const
| Return the size by which the array will be expanded whenever expansion is necessary.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.

## Constructor & Destructor Documentation

MAttributeSpecArray | ( |  | ) |

Default constructor.

The array is set to contain no elements.

MAttributeSpecArray | ( | const MAttributeSpecArray & | other | ) |

Copy Constructor.

Parameters:

  [in] | other | the array with which to initialize this array

MAttributeSpecArray | ( | unsigned int | initialSize,
|  | const MAttributeSpec & | initialValue
| ) |  |

Create a new array of MAttributeSpecs of a specified size and initialize all the elements with the given initial value.

Parameters:

  [in] | initialSize | the initial size of the array
  [in] | initialValue | the initial value of each element

## Member Function Documentation

MAttributeSpec operator[] | ( | unsigned int | index | ) | const

Index operator.

Returns the value of the element at the given index. Valid indices are 0 to length()-1.

Parameters:

  [in] | index | the index of the element to return

Returns:
  A reference to the specified element

MAttributeSpecArray & operator= | ( | const MAttributeSpecArray & | other | ) |

Assignment operator.

Parameters:

  [in] | other | The source object to assign from.

Returns:
  A reference to the copied MAttributeSpecArray object.

MStatus set | ( | const MAttributeSpec & | element,
|  | unsigned int | index
| ) |  |

Search for all occurrences

Sets the value of the specified element to the given attribute spec.

Parameters:

  [in] | element | the new value for the specified element
  [in] | index | the index of the element to be set

Returns:
  - MS::kSuccess the value was set successfully
  - MS::kFailure invalid index

MStatus setLength | ( | unsigned int | length | ) |

Search for all occurrences

Set the length of the array.

This will grow and shrink the array as desired. Elements that are grown have uninitialized values, while those which are shrunk will lose the data contained in the deleted elements (ie. it will release the memory).

Parameters:

  [in] | length | the new size of the array

Returns:
  - MS::kSuccess the method is successful.
  - MS::kFailure the method failed.

unsigned int length | ( |  | ) | const

Search for all occurrences

Returns the number of elements in the array.

Returns:
  The number of elements in the array

Examples:
  apiMeshShape.cpp.

MStatus remove | ( | unsigned int | index | ) |

Search for all occurrences

Removes the element in the array at the given index.

Parameters:

  [in] | index | the index of the element to removed

Returns:
  - MS::kSuccess the remove was successful.
  - MS::kInvalidParameter when the specified index is out of range.
  - MS::kFailure the remove failed

MStatus insert | ( | const MAttributeSpec & | element,
|  | unsigned int | index
| ) |  |

Search for all occurrences

Inserts a new value into the array at the given index.

The initial element at that index, and all following elements, are shifted towards the last.

Parameters:

  [in] | element | the new value to insert into the array
  [in] | index | the index of the element to set

Returns:
  - MS::kSuccess the insert was set successfully
  - MS::kFailure the insert failed

MStatus append | ( | const MAttributeSpec & | element | ) |

Search for all occurrences

Adds a new element to the end of the array.

Parameters:

  [in] | element | the value for the new last element

Returns:
  - MS::kSuccess the append was set successfully
  - MS::kFailure the append failed

MStatus copy | ( | const MAttributeSpecArray & | source | ) |

Search for all occurrences

Copy the contents of the source array to this array.

Parameters:

  [in] | source | array to copy from

Returns:
  MS::kSuccess if the copy was successful and MS::kFailure otherwise

MStatus clear | ( |  | ) |

Search for all occurrences

Clear the contents of the array.

After this operation the length method will return 0. This does not change the amount of memory allocated to the array, only the number of valid elements in it.

Returns:
  - MS::kSuccess the operation was set successfully
  - MS::kFailure the operation failed

void setSizeIncrement | ( | unsigned int | newIncrement | ) |

Search for all occurrences

Set the size by which the array will be expanded whenever expansion is necessary.

Parameters:

  [in] | newIncrement | the new increment

unsigned int sizeIncrement | ( |  | ) | const

Search for all occurrences

Return the size by which the array will be expanded whenever expansion is necessary.

Returns:
  The size increment.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray
MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray MAttributeSpecArray