trick/trick_source/codegen/Interface_Code_Gen/EnumValues.cpp
Alex Lin d875f837f2 ICG produces non-compilable io_* code for this weird example #334
When saving the list of namespaces and classes a particular type is contained in
we have to save the class name and any template args it includes separately.  This
allows us to mangle the names easier.  And we now search for type names to see
if they follow this pattern template_name<template_args>::embedded_class.  If
we are using a template embedded class we need to create attributes for the embedded class.
2016-11-02 13:56:40 -05:00

37 lines
970 B
C++

#include <iostream>
#include "EnumValues.hh"
EnumValues::EnumValues() : has_definition(true) {}
void EnumValues::addEnum( std::string in_name , long long in_val ) {
std::pair< std::string , long long > new_enum(in_name, in_val) ;
enum_values.push_back(new_enum) ;
}
void EnumValues::setHasDefinition( bool in ) {
has_definition = in ;
}
bool EnumValues::getHasDefinition() {
return has_definition ;
}
std::ostream & operator << (std::ostream & ostream , EnumValues & ev ) {
ostream << " name = " << ev.name << std::endl ;
ostream << " file_name = " << ev.file_name << std::endl ;
ostream << " namespaces =" ;
ev.printNamespaces(ostream) ;
ostream << std::endl ;
ostream << " parent classes =" ;
ev.printContainerClasses(ostream) ;
ostream << std::endl ;
for (auto& pair : ev.getPairs()) {
ostream << " " << pair.first << " " << pair.second << std::endl ;
}
return ostream ;
}