EMA C++ Developers Guide : 3 OMM Containers and Messages : 3.3 Working with OMM Containers : 3.3.3 Example: Populating a Map Class Relying on the Map Class Buffer
 
3.3.3 Example: Populating a Map Class Relying on the Map Class Buffer
The following example illustrates how to populate a Map class with a single entry containing a FieldList. In this case, the FieldList class uses the memory buffer owned by the Map class to store its own content while it is populated, therefore avoiding the internal buffer copy described in Section 3.3.2. This container population model applies to iterable containers only (e.g., OmmArray, ElementList, FieldList, FilterList, Map, Series, and Vector).
 
 
try {
    FieldList fieldList;
 
    Map map;
    fieldList.addUInt( 1, 64 )
        .addReal( 6, 11, OmmReal::ExponentNeg2Enum )
        .addDate( 16, 1999, 11, 7 )
        .addTime( 18, 02, 03, 04, 005 )
        .complete();
 
    map.addKeyAscii( "entry_1", MapEntry::AddEnum, fieldList );
 
        map.complete();
} catch ( const OmmException& excp ) {
    cout << excp << endl;
}