EMA C++ Developers Guide : 3 OMM Containers and Messages : 3.3 Working with OMM Containers : 3.3.2 Example: Populating a Map Class Relying on the FieldList Memory Buffer
 
3.3.2 Example: Populating a Map Class Relying on the FieldList Memory Buffer
The following code snippet illustrates how to populate a Map class with summary data and a single entry containing a FieldList. In this example, the FieldList class uses its own memory buffer to store content while it is populated. This buffer later gets copied to the buffer owned by the Map class. This container population model applies to all OMM containers that might contain other containers, primitives, or messages.
 
 
try {
FieldList fieldList;
 
fieldList.addUInt( 1, 64 )
.addReal( 6, 11, OmmReal::ExponentNeg2Enum )
.addDate( 16, 1999, 11, 7 )
.addTime( 18, 02, 03, 04, 005 )
.complete();
 
Map map;
map .summary( fieldList ).addKeyAscii( "entry_1", MapEntry::AddEnum, fieldList
).complete();
} catch ( const OmmException& excp ) {
cout << excp << endl;
}