/* * New C++ File starts here. * This file should be named nml_ex1_v2.cc * Automatically generated by NML CodeGen Java Applet. * with command line arguments : generate_symbol_lookups=true HHFile=nml_ex1_v2.hh -o nml_ex1_v2.cc * RCS_VERSION=@(#) RCS_LIBRARY_VERSION: 2009.06.05_1506:1507 Compiled on Mon Jun 8 09:24:56 EDT 2009 for the java platform. * $Id: CodeGenCommon.java 1514 2009-06-12 20:09:37Z shackle $ * * .gen script : * 0:load nml_ex1_v2.hh * 1:clear * 2:select_from_file nml_ex1_v2.hh * 3:generate C++ format>nml_ex1_v2.cc * 4:generate C++ update>nml_ex1_v2.cc * 5:generate C++ constructor>nml_ex1_v2.cc * 6:exit * */ // Include all NML, CMS, and RCS classes and functions #include "rcs.hh" // Include command and status message definitions #include "nml_ex1_v2.hh" // Forward Function Prototypes #ifndef MAX_EX_NAME_LENGTH #define MAX_EX_NAME_LENGTH 12 #endif #ifndef EX_NAME_LIST_LENGTH #define EX_NAME_LIST_LENGTH 2 #endif /* This list must be in alphabetical order and the three lists must correspond. */ const char ex_name_list[EX_NAME_LIST_LENGTH][MAX_EX_NAME_LENGTH]= { "EXAMPLE_MSG", /* 0,101 */ ""}; const NMLTYPE ex_id_list[EX_NAME_LIST_LENGTH]= { EXAMPLE_MSG_TYPE, /* 0,101 */ -1}; const size_t ex_size_list[EX_NAME_LIST_LENGTH]= { sizeof(EXAMPLE_MSG), 0}; const char *ex_symbol_lookup(long type); // Enumerated Type Constants /* Estimated_size EXAMPLE_MSG 250 Estimated_size MAXIMUM 250 */ /* * NML/CMS Format function : ex_format */ int ex_format(NMLTYPE type, void *buffer, CMS *cms) { type = cms->check_type_info(type,buffer,"ex", (cms_symbol_lookup_function_t) ex_symbol_lookup, (const char **)ex_name_list, ex_id_list,ex_size_list, EX_NAME_LIST_LENGTH, MAX_EX_NAME_LENGTH); switch(type) { case EXAMPLE_MSG_TYPE: ((EXAMPLE_MSG *) buffer)->update(cms); break; default: return(0); } return 1; } // NML Symbol Lookup Function const char *ex_symbol_lookup(long type) { switch(type) { case EXAMPLE_MSG_TYPE: return "EXAMPLE_MSG"; default: return"UNKNOWN"; break; } return(NULL); } /* * NML/CMS Update function for EXAMPLE_MSG * from nml_ex1_v2.hh:0 */ void EXAMPLE_MSG::update(CMS *cms) { cms->beginClass("EXAMPLE_MSG","NMLmsg"); cms->update_with_name("f",f); cms->update_with_name("c",c); cms->update_with_name("s",s); cms->update_with_name("i",i); cms->update_with_name("l",l); cms->update_with_name("uc",uc); cms->update_with_name("us",us); cms->update_with_name("ui",ui); cms->update_with_name("ul",ul); cms->update_dla_length_with_name("da_length",da_length); cms->update_dla_with_name("da",da,da_length,20); cms->update_with_name("name",(char *) name,10); cms->endClass("EXAMPLE_MSG","NMLmsg"); } /* * Constructor for EXAMPLE_MSG * from nml_ex1_v2.hh:0 */ EXAMPLE_MSG::EXAMPLE_MSG() : NMLmsg(EXAMPLE_MSG_TYPE,sizeof(EXAMPLE_MSG)) { f = (float) 0; c = (char) 0; s = (short) 0; i = (int) 0; l = (long) 0; uc = (unsigned char) 0; us = (unsigned short) 0; ui = (unsigned int) 0; ul = (unsigned long) 0; da_length = (int) 0; for(int i_da=0; i_da< 20; i_da++) { ((double*)da)[i_da] = (double) 0; } for(int i_name=0; i_name< 10; i_name++) { ((char*)name)[i_name] = (char) 0; } }