Commit 39ab1234 authored by Floris Berendsen's avatar Floris Berendsen
Browse files

WIP: resolved linker error. Compiler errors remaining

parent 94e32345
......@@ -24,6 +24,75 @@
namespace selx
{
// Declared outside of the class body, so it is a free function
std::ostream &
operator<<(std::ostream & out, const Blueprint::ParameterMapType & val)
{
for (auto const & mapPair : val)
{
out << mapPair.first << " : [ ";
for (auto const & value : mapPair.second)
{
out << value << " ";
}
out << "]\\n";
}
return out;
}
template< class NameType, class ParameterMapType >
class vertex_label_writer
{
public:
vertex_label_writer(NameType _name, ParameterMapType _parameterMap) : name(_name), parameterMap(_parameterMap) {}
template< class VertexOrEdge >
void operator()(std::ostream & out, const VertexOrEdge & v) const
{
out << "[label=\"" << name[v] << "\n" << parameterMap[v] << "\"]";
}
private:
NameType name;
ParameterMapType parameterMap;
};
template< class NameType, class ParameterMapType >
inline vertex_label_writer< NameType, ParameterMapType >
make_vertex_label_writer(NameType n, ParameterMapType p)
{
return vertex_label_writer< NameType, ParameterMapType >(n, p);
}
template< class ParameterMapType >
class edge_label_writer
{
public:
edge_label_writer(ParameterMapType _parameterMap) : parameterMap(_parameterMap) {}
template< class VertexOrEdge >
void operator()(std::ostream & out, const VertexOrEdge & v) const
{
out << "[label=\"" << parameterMap[v] << "\"]";
}
private:
ParameterMapType parameterMap;
};
template< class ParameterMapType >
inline edge_label_writer< ParameterMapType >
make_edge_label_writer(ParameterMapType p)
{
return edge_label_writer< ParameterMapType >(p);
}
bool
Blueprint::BlueprintImpl
......
......@@ -103,75 +103,6 @@ struct Blueprint::BlueprintImpl {
};
// Declared outside of the class body, so it is a free function
std::ostream &
operator<<( std::ostream & out, const Blueprint::ParameterMapType & val )
{
for( auto const & mapPair : val )
{
out << mapPair.first << " : [ ";
for( auto const & value : mapPair.second )
{
out << value << " ";
}
out << "]\\n";
}
return out;
}
template< class NameType, class ParameterMapType >
class vertex_label_writer
{
public:
vertex_label_writer( NameType _name, ParameterMapType _parameterMap ) : name( _name ), parameterMap( _parameterMap ) {}
template< class VertexOrEdge >
void operator()( std::ostream & out, const VertexOrEdge & v ) const
{
out << "[label=\"" << name[ v ] << "\n" << parameterMap[ v ] << "\"]";
}
private:
NameType name;
ParameterMapType parameterMap;
};
template< class NameType, class ParameterMapType >
inline vertex_label_writer< NameType, ParameterMapType >
make_vertex_label_writer( NameType n, ParameterMapType p )
{
return vertex_label_writer< NameType, ParameterMapType >( n, p );
}
template< class ParameterMapType >
class edge_label_writer
{
public:
edge_label_writer( ParameterMapType _parameterMap ) : parameterMap( _parameterMap ) {}
template< class VertexOrEdge >
void operator()( std::ostream & out, const VertexOrEdge & v ) const
{
out << "[label=\"" << parameterMap[ v ] << "\"]";
}
private:
ParameterMapType parameterMap;
};
template< class ParameterMapType >
inline edge_label_writer< ParameterMapType >
make_edge_label_writer( ParameterMapType p )
{
return edge_label_writer< ParameterMapType >( p );
}
} // namespace selx
#endif // #ifndef BlueprintImpl_h
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment