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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes

# AttachDirectly Class Reference

Search for all occurrences

## Detailed Description

Helper class to provide a simple implementation the the adsk::Data::Attach interface.

Simply stores the metadata directly in the class.

Use this class as a mix-in to any class to which you want metadata added

`#include <adskDataAttachDirectly.h>`

Inheritance diagram for AttachDirectly:
[legend]

List of all members.

## Public Member Functions
| AttachDirectly ()
| Default constructor.
virtual | ~AttachDirectly ()
| Default destructor.
| AttachDirectly (const AttachDirectly &)
| Copy constructor, duplicates the metadata, which is ref-counted.
virtual adsk::Data::Associations * | editableMetadata ()
| Get the metadata associated with this object in an editable form.
virtual const adsk::Data::Associations * | metadata () const
| Get the metadata associated with this object.
virtual bool | setMetadata (const adsk::Data::Associations &)
| Replace the object's metadata.
virtual bool | deleteMetadata ()
| Remove the object's metadata.
## Protected Attributes
adsk::Data::Associations * | fMetadata
| Metadata stored as a pointer to allow differentiation between "no metadata" and "empty metadata" if necessary. Search for all occurrences

## Constructor & Destructor Documentation

AttachDirectly | ( | const AttachDirectly & | rhs | ) |

Copy constructor, duplicates the metadata, which is ref-counted.

Parameters:

  [in] | rhs | AttachDirectly data to be copied

## Member Function Documentation

adsk::Data::Associations * editableMetadata | ( |  | ) | `[virtual]`

Search for all occurrences

Get the metadata associated with this object in an editable form.

Normally you wouldn't use this method to get metadata since modifying it directly bypasses the undo mechanism but sometimes that is the expediant thing to do.

Returns:
  Pointer to metadata associated with the object, or NULL if there isn't any

Implements Attach.

const adsk::Data::Associations * metadata | ( |  | ) | const`[virtual]`

Search for all occurrences

Get the metadata associated with this object.

Returns:
  Pointer to metadata associated with the object, or NULL if there isn't any

Implements Attach.

bool setMetadata | ( | const adsk::Data::Associations & | newMetadata | ) | `[virtual]`

Search for all occurrences

Replace the object's metadata.

Parameters:

  [in] | newMetadata | New metadata to be set, replaces existing metadata

Returns:
  True if the new metadata was successfully set

Implements Attach.

bool deleteMetadata | ( |  | ) | `[virtual]`

Search for all occurrences

Remove the object's metadata.

Returns:
  True if the new metadata was successfully removed

Implements Attach.

AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly
AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly AttachDirectly