2014-02-17 22:13:55 +00:00
###############################################################################
# #
# This file is part of IfcOpenShell. #
# #
# IfcOpenShell is free software: you can redistribute it and/or modify #
# it under the terms of the Lesser GNU General Public License as published by #
# the Free Software Foundation, either version 3.0 of the License, or #
# (at your option) any later version. #
# #
# IfcOpenShell is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# Lesser GNU General Public License for more details. #
# #
# You should have received a copy of the Lesser GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
header = """
#ifndef %(schema_name_upper)s _H
#define %(schema_name_upper)s _H
#include <string>
#include <vector>
#include <boost/optional.hpp>
2016-05-29 18:12:57 +06:00
#include " ../ifcparse/IfcParse_Export.h "
2014-02-17 22:13:55 +00:00
#include " ../ifcparse/IfcUtil.h "
#include " ../ifcparse/IfcException.h "
#include " ../ifcparse/ %(schema_name)s enum.h "
2015-11-22 02:20:34 +02:00
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4100)
#endif
2014-02-17 22:13:55 +00:00
#define IfcSchema %(schema_name)s
namespace %(schema_name)s {
2015-01-05 17:46:23 +00:00
const char* const Identifier = " %(schema_name_upper)s " ;
2014-02-17 22:13:55 +00:00
// Forward definitions
%(forward_definitions)s
%(declarations)s
%(class_definitions)s
void InitStringMap();
2014-05-04 14:42:55 +00:00
IfcUtil::IfcBaseClass* SchemaEntity(IfcAbstractEntity* e = 0);
2014-02-17 22:13:55 +00:00
}
2015-11-22 02:20:34 +02:00
#ifdef _MSC_VER
#pragma warning(pop)
#endif
2014-02-17 22:13:55 +00:00
#endif
"""
enum_header = """
#ifndef %(schema_name_upper)s ENUM_H
#define %(schema_name_upper)s ENUM_H
2016-05-29 18:12:57 +06:00
#include " ../ifcparse/IfcParse_Export.h "
2016-03-18 11:14:14 +01:00
#include <boost/optional.hpp>
2014-02-17 22:13:55 +00:00
#define IfcSchema %(schema_name)s
namespace %(schema_name)s {
namespace Type {
typedef enum {
2015-02-17 19:48:41 +00:00
%(types)s , UNDEFINED
2014-02-17 22:13:55 +00:00
} Enum;
2016-05-29 18:12:57 +06:00
IfcParse_EXPORT boost::optional<Enum> Parent(Enum v);
IfcParse_EXPORT Enum FromString(const std::string& s);
IfcParse_EXPORT std::string ToString(Enum v);
IfcParse_EXPORT bool IsSimple(Enum v);
2014-02-17 22:13:55 +00:00
}
}
#endif
"""
2015-01-05 14:11:42 +00:00
lb_header = """
#ifndef %(schema_name_upper)s RT_H
#define %(schema_name_upper)s RT_H
#define IfcSchema %(schema_name)s
2016-05-30 13:54:24 +03:00
#include " ../ifcparse/IfcParse_Export.h "
2015-01-05 14:11:42 +00:00
#include " ../ifcparse/IfcUtil.h "
#include " ../ifcparse/IfcEntityDescriptor.h "
#include " ../ifcparse/IfcWritableEntity.h "
namespace %(schema_name)s {
namespace Type {
2016-05-30 13:54:24 +03:00
IfcParse_EXPORT int GetAttributeCount(Enum t);
IfcParse_EXPORT int GetAttributeIndex(Enum t, const std::string& a);
IfcParse_EXPORT IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
IfcParse_EXPORT Enum GetAttributeEntity(Enum t, unsigned char a);
IfcParse_EXPORT const std::string& GetAttributeName(Enum t, unsigned char a);
IfcParse_EXPORT bool GetAttributeOptional(Enum t, unsigned char a);
IfcParse_EXPORT bool GetAttributeDerived(Enum t, unsigned char a);
IfcParse_EXPORT std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
IfcParse_EXPORT std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
IfcParse_EXPORT std::set<std::string> GetInverseAttributeNames(Enum t);
IfcParse_EXPORT void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
2015-01-05 14:11:42 +00:00
}}
#endif
"""
2014-02-17 22:13:55 +00:00
implementation = """
#include " ../ifcparse/ %(schema_name)s .h "
#include " ../ifcparse/IfcException.h "
#include " ../ifcparse/IfcWrite.h "
#include " ../ifcparse/IfcWritableEntity.h "
2015-11-22 02:20:34 +02:00
#include <map>
2014-02-17 22:13:55 +00:00
using namespace %(schema_name)s ;
using namespace IfcParse;
using namespace IfcWrite;
2014-05-04 14:42:55 +00:00
IfcUtil::IfcBaseClass* %(schema_name)s ::SchemaEntity(IfcAbstractEntity* e) {
2014-02-17 22:13:55 +00:00
switch(e->type()) {
%(schema_entity_statements)s
default: throw IfcException( " Unable to find find keyword in schema " ); break;
}
}
std::string Type::ToString(Enum v) {
if (v < 0 || v >= %(max_id)d ) throw IfcException( " Unable to find find keyword in schema " );
const char* names[] = { %(type_name_strings)s };
return names[v];
}
static std::map<std::string,Type::Enum> string_map;
void %(schema_name)s ::InitStringMap() {
%(string_map_statements)s
}
Type::Enum Type::FromString(const std::string& s) {
2015-01-05 14:11:42 +00:00
if (string_map.empty()) InitStringMap();
2014-02-17 22:13:55 +00:00
std::map<std::string,Type::Enum>::const_iterator it = string_map.find(s);
if ( it == string_map.end() ) throw IfcException( " Unable to find find keyword in schema " );
else return it->second;
}
2016-03-18 11:14:14 +01:00
static int parent_map[] = { %(parent_type_statements)s };
boost::optional<Type::Enum> Type::Parent(Enum v) {
const int p = parent_map[static_cast<int>(v)];
if (p >= 0) {
return static_cast<Type::Enum>(p);
} else {
return boost::none;
}
2014-02-17 22:13:55 +00:00
}
bool Type::IsSimple(Enum v) {
return %(simple_type_statement)s ;
}
%(enumeration_functions)s
2015-01-05 14:11:42 +00:00
%(simple_type_impl)s
2014-02-17 22:13:55 +00:00
%(entity_implementations)s
"""
2015-01-05 14:11:42 +00:00
lb_implementation = """
#include <set>
#include " ../ifcparse/ %(schema_name)s .h "
#include " ../ifcparse/ %(schema_name)s -latebound.h "
#include " ../ifcparse/IfcException.h "
#include " ../ifcparse/IfcWrite.h "
#include " ../ifcparse/IfcWritableEntity.h "
#include " ../ifcparse/IfcUtil.h "
#include " ../ifcparse/IfcEntityDescriptor.h "
using namespace %(schema_name)s ;
using namespace IfcParse;
using namespace IfcWrite;
using namespace IfcUtil;
2015-02-27 13:41:33 +00:00
typedef std::map<Type::Enum,IfcEntityDescriptor*> entity_descriptor_map_t;
typedef std::map<Type::Enum,IfcEnumerationDescriptor*> enumeration_descriptor_map_t;
typedef std::map<Type::Enum, std::map<std::string, std::pair<Type::Enum, int> > > inverse_map_t;
typedef std::map<Type::Enum,std::set<int> > derived_map_t;
entity_descriptor_map_t entity_descriptor_map;
enumeration_descriptor_map_t enumeration_descriptor_map;
inverse_map_t inverse_map;
derived_map_t derived_map;
2015-01-05 14:11:42 +00:00
2015-03-22 19:52:29 +00:00
#ifdef _MSC_VER
# pragma optimize( " " , off )
#endif
2015-01-05 14:11:42 +00:00
void InitDescriptorMap() {
IfcEntityDescriptor* current;
%(entity_descriptors)s
// Enumerations
IfcEnumerationDescriptor* current_enum;
std::vector<std::string> values;
%(enumeration_descriptors)s
}
2015-03-22 19:52:29 +00:00
#ifdef _MSC_VER
# pragma optimize( " " , on )
#endif
2015-01-05 14:11:42 +00:00
void InitInverseMap() {
%(inverse_implementations)s
}
void InitDerivedMap() {
%(derived_field_statements)s
}
int Type::GetAttributeIndex(Enum t, const std::string& a) {
if (entity_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEntityDescriptor*>::const_iterator i = entity_descriptor_map.find(t);
if ( i == entity_descriptor_map.end() ) throw IfcException( " Type not found " );
else return i->second->getArgumentIndex(a);
}
int Type::GetAttributeCount(Enum t) {
if (entity_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEntityDescriptor*>::const_iterator i = entity_descriptor_map.find(t);
if ( i == entity_descriptor_map.end() ) throw IfcException( " Type not found " );
else return i->second->getArgumentCount();
}
ArgumentType Type::GetAttributeType(Enum t, unsigned char a) {
if (entity_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEntityDescriptor*>::const_iterator i = entity_descriptor_map.find(t);
if ( i == entity_descriptor_map.end() ) throw IfcException( " Type not found " );
else return i->second->getArgumentType(a);
}
2015-02-17 19:48:41 +00:00
Type::Enum Type::GetAttributeEntity(Enum t, unsigned char a) {
if (entity_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEntityDescriptor*>::const_iterator i = entity_descriptor_map.find(t);
if ( i == entity_descriptor_map.end() ) throw IfcException( " Type not found " );
else return i->second->getArgumentEntity(a);
}
2015-01-05 14:11:42 +00:00
const std::string& Type::GetAttributeName(Enum t, unsigned char a) {
if (entity_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEntityDescriptor*>::const_iterator i = entity_descriptor_map.find(t);
if ( i == entity_descriptor_map.end() ) throw IfcException( " Type not found " );
else return i->second->getArgumentName(a);
}
bool Type::GetAttributeOptional(Enum t, unsigned char a) {
if (entity_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEntityDescriptor*>::const_iterator i = entity_descriptor_map.find(t);
if ( i == entity_descriptor_map.end() ) throw IfcException( " Type not found " );
else return i->second->getArgumentOptional(a);
}
bool Type::GetAttributeDerived(Enum t, unsigned char a) {
if (derived_map.empty()) ::InitDerivedMap();
std::map<Type::Enum,std::set<int> >::const_iterator i = derived_map.find(t);
return i != derived_map.end() && i->second.find(a) != i->second.end();
}
std::pair<const char*, int> Type::GetEnumerationIndex(Enum t, const std::string& a) {
if (enumeration_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEnumerationDescriptor*>::const_iterator i = enumeration_descriptor_map.find(t);
if ( i == enumeration_descriptor_map.end() ) throw IfcException( " Value not found " );
else return i->second->getIndex(a);
}
std::pair<Type::Enum, unsigned> Type::GetInverseAttribute(Enum t, const std::string& a) {
2015-11-22 02:20:34 +02:00
if (inverse_map.empty()) ::InitInverseMap();
inverse_map_t::const_iterator it;
inverse_map_t::mapped_type::const_iterator jt;
for(;;) {
2015-02-27 13:41:33 +00:00
it = inverse_map.find(t);
if (it != inverse_map.end()) {
2015-11-22 02:20:34 +02:00
jt = it->second.find(a);
if (jt != it->second.end()) {
return jt->second;
}
}
2016-03-18 11:14:14 +01:00
boost::optional<Enum> pt = Parent(t);
if (pt) {
t = *pt;
}
else {
break;
}
2015-01-05 14:11:42 +00:00
}
throw IfcException( " Attribute not found " );
}
2015-02-27 13:41:33 +00:00
std::set<std::string> Type::GetInverseAttributeNames(Enum t) {
2015-11-22 02:20:34 +02:00
if (inverse_map.empty()) ::InitInverseMap();
inverse_map_t::const_iterator it;
inverse_map_t::mapped_type::const_iterator jt;
2015-02-27 13:41:33 +00:00
2015-11-22 02:20:34 +02:00
std::set<std::string> return_value;
2015-02-27 13:41:33 +00:00
2015-11-22 02:20:34 +02:00
for (;;) {
2015-02-27 13:41:33 +00:00
it = inverse_map.find(t);
if (it != inverse_map.end()) {
2015-11-22 02:20:34 +02:00
for (jt = it->second.begin(); jt != it->second.end(); ++jt) {
return_value.insert(jt->first);
}
}
2016-03-18 11:14:14 +01:00
boost::optional<Enum> pt = Parent(t);
if (pt) {
t = *pt;
}
else {
break;
}
2015-02-27 13:41:33 +00:00
}
2015-11-22 02:20:34 +02:00
return return_value;
2015-02-27 13:41:33 +00:00
}
2015-01-05 14:11:42 +00:00
void Type::PopulateDerivedFields(IfcWrite::IfcWritableEntity* e) {
std::map<Type::Enum, std::set<int> >::const_iterator i = derived_map.find(e->type());
2015-11-22 02:20:34 +02:00
if (i != derived_map.end()) {
for (std::set<int>::const_iterator it = i->second.begin(); it != i->second.end(); ++it) {
e->setArgumentDerived(*it);
}
}
2015-01-05 14:11:42 +00:00
}
"""
entity_descriptor = """ current = entity_descriptor_map[Type:: %(type)s ] = new IfcEntityDescriptor(Type:: %(type)s , %(parent_statement)s );
%(entity_descriptor_attributes)s """
entity_descriptor_parent = " entity_descriptor_map.find(Type:: %(type)s )->second "
2015-02-17 19:48:41 +00:00
entity_descriptor_attribute_without_entity = ' current->add( " %(name)s " , %(optional)s , %(type)s ); '
entity_descriptor_attribute_with_entity = ' current->add( " %(name)s " , %(optional)s , %(type)s ,Type:: %(entity_name)s ); '
2015-01-05 14:11:42 +00:00
enumeration_descriptor = """ values.clear(); values.reserve(128);
%(enumeration_descriptor_values)s
current_enum = enumeration_descriptor_map[Type:: %(type)s ] = new IfcEnumerationDescriptor(Type:: %(type)s , values); """
enumeration_descriptor_value = ' values.push_back( " %(name)s " ); '
derived_field_statement = ' { std::set<int> idxs; %(statements)s derived_map[Type:: %(type)s ] = idxs;} ' ;
derived_field_statement_attrs = ' idxs.insert( %d ); '
2014-02-17 22:13:55 +00:00
simpletype = """ %(documentation)s
2016-05-29 18:12:57 +06:00
class IfcParse_EXPORT %(name)s : public %(superclass)s {
2015-01-05 14:11:42 +00:00
public:
virtual IfcUtil::ArgumentType getArgumentType(unsigned int i) const;
virtual Argument* getArgument(unsigned int i) const;
bool is(Type::Enum v) const;
Type::Enum type() const;
static Type::Enum Class();
explicit %(name)s (IfcAbstractEntity* e);
%(name)s ( %(type)s v);
operator %(type)s () const;
};
2014-02-17 22:13:55 +00:00
"""
2015-01-05 14:11:42 +00:00
simpletype_impl_comment = " // Function implementations for %(name)s "
2015-06-17 11:04:28 +00:00
simpletype_impl_argument_type = " if (i == 0) { return %(attr_type)s ; } else { throw IfcParse::IfcAttributeOutOfRangeException( \" Argument index out of range \" ); } "
2015-01-05 14:11:42 +00:00
simpletype_impl_argument = " return entity->getArgument(i); "
simpletype_impl_is_with_supertype = " return v == Type:: %(class_name)s || %(superclass)s ::is(v); "
simpletype_impl_is_without_supertype = " return v == %(class_name)s ::Class(); "
simpletype_impl_type = " return Type:: %(class_name)s ; "
simpletype_impl_class = " return Type:: %(class_name)s ; "
simpletype_impl_explicit_constructor = " entity = e; "
simpletype_impl_constructor = " IfcWritableEntity* e = new IfcWritableEntity(Type:: %(class_name)s ); e->setArgument(0, v); entity = e; "
2015-05-21 12:09:57 +00:00
simpletype_impl_constructor_templated = " IfcWritableEntity* e = new IfcWritableEntity(Type:: %(class_name)s ); e->setArgument(0, v->generalize()); entity = e; "
simpletype_impl_cast = " return *entity->getArgument(0); "
simpletype_impl_cast_templated = " IfcEntityList::ptr es = *entity->getArgument(0); return es->as< %(underlying_type)s >(); "
2015-01-05 14:11:42 +00:00
2014-02-17 22:13:55 +00:00
select = """ %(documentation)s
2015-01-05 14:11:42 +00:00
typedef IfcUtil::IfcBaseClass %(name)s ;
2014-02-17 22:13:55 +00:00
"""
enumeration = """ namespace %(name)s {
%(documentation)s
typedef enum { %(values)s } %(name)s ;
2016-05-30 13:54:24 +03:00
IfcParse_EXPORT const char* ToString( %(name)s v);
IfcParse_EXPORT %(name)s FromString(const std::string& s);
2014-02-17 22:13:55 +00:00
}
"""
entity = """ %(documentation)s
2016-05-29 18:12:57 +06:00
class IfcParse_EXPORT %(name)s %(superclass)s {
2014-02-17 22:13:55 +00:00
public:
%(attributes)s virtual unsigned int getArgumentCount() const { return %(argument_count)d ; }
virtual IfcUtil::ArgumentType getArgumentType(unsigned int i) const { %(argument_type_function_body)s }
2015-02-17 19:48:41 +00:00
virtual Type::Enum getArgumentEntity(unsigned int i) const { %(argument_entity_function_body)s }
2014-02-17 22:13:55 +00:00
virtual const char* getArgumentName(unsigned int i) const { %(argument_name_function_body)s }
2014-05-04 14:42:55 +00:00
virtual Argument* getArgument(unsigned int i) const { return entity->getArgument(i); }
2014-02-17 22:13:55 +00:00
%(inverse)s bool is(Type::Enum v) const;
Type::Enum type() const;
static Type::Enum Class();
2014-05-04 14:42:55 +00:00
%(name)s (IfcAbstractEntity* e);
2014-02-17 22:13:55 +00:00
%(name)s ( %(constructor_arguments)s );
2014-05-04 14:42:55 +00:00
typedef IfcTemplatedEntityList< %(name)s > list;
2014-02-17 22:13:55 +00:00
};
"""
enumeration_function = """
const char* %(name)s ::ToString( %(name)s v) {
if ( v < 0 || v >= %(max_id)d ) throw IfcException( " Unable to find find keyword in schema " );
const char* names[] = { %(values)s };
return names[v];
}
%(name)s :: %(name)s %(name)s ::FromString(const std::string& s) {
%(from_string_statements)s
throw IfcException( " Unable to find find keyword in schema " );
}
"""
entity_implementation = """ // Function implementations for %(name)s
%(attributes)s %(inverse)s bool %(name)s ::is(Type::Enum v) const { return v == Type:: %(name)s %(parent_type_test)s ; }
Type::Enum %(name)s ::type() const { return Type:: %(name)s ; }
Type::Enum %(name)s ::Class() { return Type:: %(name)s ; }
2014-05-04 14:42:55 +00:00
%(name)s :: %(name)s (IfcAbstractEntity* e) : %(superclass)s { if (!e) return; if (!e->is(Type:: %(name)s )) throw IfcException( " Unable to find find keyword in schema " ); entity = e; }
2014-02-17 22:13:55 +00:00
%(name)s :: %(name)s ( %(constructor_arguments)s ) : %(superclass)s { IfcWritableEntity* e = new IfcWritableEntity(Class()); %(constructor_implementation)s entity = e; EntityBuffer::Add(this); }
"""
optional_attribute_description = " /// Whether the optional attribute %s is defined for this %s "
function = " %(return_type)s %(class_name)s :: %(name)s ( %(arguments)s ) { %(body)s } "
2014-05-04 14:42:55 +00:00
const_function = " %(return_type)s %(class_name)s :: %(name)s ( %(arguments)s ) const { %(body)s } "
2015-01-05 14:11:42 +00:00
constructor = " %(class_name)s :: %(class_name)s ( %(arguments)s ) { %(body)s } "
constructor_single_initlist = " %(class_name)s :: %(class_name)s ( %(arguments)s ) : %(superclass)s ( %(superclass_init)s ) { %(body)s } "
cast_function = " %(class_name)s ::operator %(return_type)s () const { %(body)s } "
2014-02-17 22:13:55 +00:00
array_type = " std::vector< %(instance_type)s > /*[ %(lower)s : %(upper)s ]*/ "
2015-06-16 12:58:07 +00:00
nested_array_type = " std::vector< std::vector< %(instance_type)s > > "
2014-05-04 14:42:55 +00:00
list_type = " IfcTemplatedEntityList< %(instance_type)s >::ptr "
list_list_type = " IfcTemplatedEntityListList< %(instance_type)s >::ptr "
untyped_list = " IfcEntityList::ptr "
inverse_attr = " IfcTemplatedEntityList< %(entity)s >::ptr %(name)s () const; // INVERSE %(entity)s :: %(attribute)s "
2014-02-17 22:13:55 +00:00
enum_from_string_stmt = ' if (s == " %(value)s " ) return :: %(schema_name)s :: %(name)s :: %(short_name)s _ %(value)s ; '
schema_entity_stmt = ' case Type:: %(name)s : return new %(name)s (e); break; '
string_map_statement = ' string_map[ " %(uppercase_name)s " %(padding)s ] = Type:: %(name)s ; '
parent_type_stmt = ' if(v== %(name)s %(padding)s ) { return %(parent)s ; } '
parent_type_test = " || %s ::is(v) "
optional_attr_stmt = " return !entity->getArgument( %(index)d )->isNull(); "
get_attr_stmt = " return *entity->getArgument( %(index)d ); "
get_attr_stmt_enum = " return %(type)s ::FromString(*entity->getArgument( %(index)d )); "
2014-05-04 14:42:55 +00:00
get_attr_stmt_entity = " return ( %(type)s )((IfcUtil::IfcBaseClass*)(*entity->getArgument( %(index)d ))); "
get_attr_stmt_array = " IfcEntityList::ptr es = *entity->getArgument( %(index)d ); return es->as< %(list_instance_type)s >(); "
get_attr_stmt_nested_array = " IfcEntityListList::ptr es = *entity->getArgument( %(index)d ); return es->as< %(list_instance_type)s >(); "
2014-02-17 22:13:55 +00:00
2015-01-10 22:13:52 +00:00
get_inverse = " return entity->getInverse(Type:: %(type)s , %(index)d )->as< %(type)s >(); "
2014-02-17 22:13:55 +00:00
set_attr_stmt = " if ( ! entity->isWritable() ) { entity = new IfcWritableEntity(entity); } ((IfcWritableEntity*)entity)->setArgument( %(index)d ,v); "
set_attr_stmt_enum = " if ( ! entity->isWritable() ) { entity = new IfcWritableEntity(entity); } ((IfcWritableEntity*)entity)->setArgument( %(index)d ,v, %(type)s ::ToString(v)); "
set_attr_stmt_array = " if ( ! entity->isWritable() ) { entity = new IfcWritableEntity(entity); } ((IfcWritableEntity*)entity)->setArgument( %(index)d ,v->generalize()); "
constructor_stmt = " e->setArgument( %(index)d ,( %(name)s )); "
constructor_stmt_enum = " e->setArgument( %(index)d , %(name)s , %(type)s ::ToString( %(name)s )); "
constructor_stmt_array = " e->setArgument( %(index)d ,( %(name)s )->generalize()); "
constructor_stmt_optional = " if ( %(name)s ) { %(stmt)s } else { e->setArgument( %(index)d ); } "
constructor_stmt_derived = " e->setArgumentDerived( %(index)d ); "
2015-02-27 13:41:33 +00:00
inverse_implementation = " inverse_map[Type:: %(type)s ].insert(std::make_pair( \" %(name)s \" , std::make_pair(Type:: %(related_type)s , %(index)d ))); "
2015-01-05 14:11:42 +00:00
2014-02-17 22:13:55 +00:00
def multi_line_comment ( li ) :
return ( " /// %s " % ( " \n /// " . join ( li ) ) ) if len ( li ) else " "