Realizing server attributes

About this task

Each attribute defined in a CORBA interface is mapped to a CORBA attribute of the same name in the IDL file. The standard IDL generator generates accessor (get) and mutator (set) operations for all attributes. For example, for an attribute named att, the following accessor and mutator are generated in the IDL file:


att(); // accessor
att(value); // mutator

Classes that inherit from CORBA interfaces must implement the accessor and mutator operations for each attribute, except for readonly attributes, which do not require a mutator.

Although C++ allows method overloading, it does not allow a data member and a method to have the same name. Therefore, the data member in the realizing class must not have the same name as the attribute in the CORBA interface. You copy the attributes from the CORBA interface to the realizing class.