Generating accessors for attributes

 

These are the accessors generated by C++ Developer when the "Create accessors" command is activated.  These accessors are created in the model, meaning they are created in the form of modeled methods.  They are automatically decorated for subsequent C++ generation.

 

Attribute type

Card

Declaration
(as generated by automatic guessing)

Get accessor

Set accessor

integer   

0..1

int* att;

const int* getAtt() const

void setAtt(int* value)

1..1

int att;

int getAtt() const

void setAtt(int value)

0..*

std::vector<int> att;

std::vector<int>& getAtt() const

 

1..*

std::vector<int> att;

std::vector<int>& getAtt() const

 

n..m

std::vector<int> att;

std::vector<int>& getAtt() const

 

string                  

0..1

std::string* att;

std::string* getAtt() const

void setAtt(std::string* value)

1..1

std::string att;

std::string getAtt() const

void setAtt(std::string value)

0..*

std::vector<std::string> att;

std::vector<std::string>& getAtt() const

 

1..*

std::vector<std::string> att;

std::vector<std::string>& getAtt() const

 

n..m

std::vector<std::string> att;

std::vector<std::string>& getAtt() const

 

MyClass             

0..1

MyClass* att;

MyClass* getAtt() const

void setAtt(MyClass* value)

 

1..1

MyClass att;

MyClass& getAtt() const

void setAtt(MyClass value)

0..*

std::vector<MyClass*> att;

std::vector<MyClass*>& getAtt() const

 

1..*

std::vector<MyClass*> att;

std::vector<MyClass*>& getAtt() const

 

n..m

std::vector<MyClass*> att;

std::vector<MyClass*>& getAtt() const

 

MyDatatype
isPrimitive=true   

0..1

MyDatatype* att;

MyDatatype* getAtt() const

void setAtt(MyDatatype* value)

1..1

MyDatatype att;

MyDatatype getAtt() const

void setAtt(MyDatatype value)

0..*

std::vector<MyDatatype> att;

std::vector<MyDatatype>& getAtt() const

 

1..*

std::vector<MyDatatype> att;

std::vector<MyDatatype>& getAtt() const

 

n..m

std::vector<MyDatatype> att;

std::vector<MyDatatype>& getAtt() const

 

MyDatatype isPrimitive=false              

0..1

MyDatatype* att;

MyDatatype* getAtt() const

void setAtt(MyDatatype* value)

1..1

MyDatatype att;

MyDatatype& getAtt() const

void setAtt(MyDatatype value)

0..*

std::vector<MyDatatype*> att;

std::vector<MyDatatype*>& getAtt() const

 

1..*

std::vector<MyDatatype*> att;

std::vector<MyDatatype*>& getAtt() const

 

n..m

std::vector<MyDatatype*> att;

std::vector<MyDatatype*>& getAtt() const

 

 

Note 1:   Where the table states integer, this can be any basic type (integer, char, float, boolean).

 

Note 2:   Accessors with maximum cardinality "*" return a reference to the internal collection, so the user can directly manipulate the container contents using the accessors specific to the container type.  There are no "set" accessors for these cases and we recommend that you use the "get" accessor and the proper container API on the returned value.