Modeling Services > Entry and Derived Data Members > Entry Data Members > Constructing an Entry Data Member
 
Constructing an Entry Data Member
Entry data members are generated classes that do not have a default constructor. Rogue Wave® Server provides them with two constructors. As its argument, the first constructor takes a reference to the class in which the entry is declared. The second constructor takes a reference to the class in which the entry is declared as its first argument and the initial value of the entry as its second argument. These two constructors also take an additional parameter which specifies the “activity” of the entry. For details on this parameter, see “Derived Data Members”..
According to C++ semantics, these constructors must be called from the constructor of the class in which the entry is declared. You can either initialize the entry in the initialization list of the constructor or leave it uninitialized as illustrated below:
Flight::Flight():
passengers(*this)
{
}
In that example, the constructor of passengers is called from the constructor of Flight and the value of the entry is left uninitialized.
Flight::Flight():
passengers(*this,10)
{
}
In that example, the constructor of passengers is called from the constructor of Flight and the entry is initialized to 10.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.