mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 05:07:54 +00:00
d875f837f2
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.
37 lines
970 B
C++
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 ;
|
|
}
|