mirror of
https://github.com/nasa/trick.git
synced 2024-12-24 15:26:41 +00:00
f825dc00fc
* #1041 filter -W workaround for ICG linking to LLVM 10 libclang-cpp.so (#1044) * 1043 drg checkpoint memory leak (#1045) * #1043 drg fix drg checkpoint memory leak * 947 sie generation rework (#1046) generate S_sie.resource at during build instead of runtime
64 lines
2.1 KiB
C++
64 lines
2.1 KiB
C++
|
|
#ifndef PRINTFILECONTENTSBASE_HH
|
|
#define PRINTFILECONTENTSBASE_HH
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <map>
|
|
#include <set>
|
|
|
|
class ConstructValues ;
|
|
class ClassValues ;
|
|
class EnumValues ;
|
|
class FieldDescription ;
|
|
|
|
/**
|
|
|
|
This class prints Trick 10 style io_src code. Given a vector of class information,
|
|
this class determines the io_src code file names, excluding files in system directories,
|
|
and writes out the attributes.
|
|
|
|
@author Alexander S. Lin
|
|
|
|
@date July 2012
|
|
|
|
*/
|
|
|
|
class PrintFileContentsBase {
|
|
public:
|
|
PrintFileContentsBase() ;
|
|
|
|
virtual void printIOHeader(std::ostream & ostream, std::string header_file_name) = 0 ;
|
|
virtual void printClass(std::ostream & ostream, ClassValues * cv) = 0 ;
|
|
virtual void printEnum(std::ostream & ostream, EnumValues * ev) = 0 ;
|
|
|
|
// these routines provide default empty implementation
|
|
virtual void printClassMapHeader(std::ostream & ostream, std::string function_name ) ;
|
|
virtual void printClassMap(std::ostream & ostream, ClassValues * cv) ;
|
|
virtual void printClassMapFooter(std::ostream & ostream) ;
|
|
|
|
virtual void printEnumMapHeader(std::ostream & ostream, std::string function_name ) ;
|
|
virtual void printEnumMap(std::ostream & ostream, EnumValues * ev) ;
|
|
virtual void printEnumMapFooter(std::ostream & ostream) ;
|
|
|
|
/* gets a vector of fields that can be printed */
|
|
std::vector<FieldDescription*> getPrintableFields(ClassValues& classValues, unsigned int ioMask = 0xFFFFFFF);
|
|
|
|
protected:
|
|
/** Prints the io_src_allocate function */
|
|
virtual void print_units_map(std::ostream & ostream, ClassValues * cv) ;
|
|
|
|
/** Prints "extern \"C\" {" */
|
|
void print_open_extern_c(std::ostream & ostream) ;
|
|
|
|
/** Prints "} // extern C" */
|
|
void print_close_extern_c(std::ostream & ostream) ;
|
|
|
|
/* internal function determines if a particular field is printable */
|
|
bool isPrintable(ClassValues * c , FieldDescription *fdes , unsigned int ioMask = 0xFFFFFFF) ;
|
|
|
|
} ;
|
|
|
|
#endif
|