aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/hybrid/serializer-aggregate-header.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-22 15:07:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-22 15:07:35 +0200
commit973221821ac8e20da4eadbf4ad552f686b1ace48 (patch)
tree861059c9606d07487f08413b35172fe2b5fa3733 /xsde/cxx/hybrid/serializer-aggregate-header.cxx
parentb2efa0d81f7e28017789082138cb547e6bea4028 (diff)
Get rid of dependency on libcult
Diffstat (limited to 'xsde/cxx/hybrid/serializer-aggregate-header.cxx')
-rw-r--r--xsde/cxx/hybrid/serializer-aggregate-header.cxx129
1 files changed, 65 insertions, 64 deletions
diff --git a/xsde/cxx/hybrid/serializer-aggregate-header.cxx b/xsde/cxx/hybrid/serializer-aggregate-header.cxx
index cfcb203..e8316b7 100644
--- a/xsde/cxx/hybrid/serializer-aggregate-header.cxx
+++ b/xsde/cxx/hybrid/serializer-aggregate-header.cxx
@@ -3,6 +3,8 @@
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+#include <set>
+
#include <cxx/hybrid/serializer-aggregate-header.hxx>
#include <cxx/hybrid/aggregate-elements.hxx>
#include <cxx/hybrid/aggregate-include.hxx>
@@ -10,8 +12,7 @@
#include <xsd-frontend/semantic-graph.hxx>
#include <xsd-frontend/traversal.hxx>
-#include <cult/containers/map.hxx>
-#include <cult/containers/set.hxx>
+using namespace std;
namespace CXX
{
@@ -19,7 +20,7 @@ namespace CXX
{
namespace
{
- typedef Cult::Containers::Set<String> InstanceSet;
+ typedef set<String> InstanceSet;
// For base types we only want member's types, but not the
// base itself.
@@ -33,7 +34,7 @@ namespace CXX
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& c)
{
inherits (c);
@@ -45,7 +46,7 @@ namespace CXX
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::List& l)
{
def_.dispatch (l.argumented ().type ());
@@ -147,7 +148,7 @@ namespace CXX
belongs_ >> *this;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Type& t)
{
if (map_.find (&t) == map_.end ())
@@ -159,7 +160,7 @@ namespace CXX
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::List& l)
{
if (map_.find (&l) == map_.end ())
@@ -172,7 +173,7 @@ namespace CXX
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& c)
{
if (map_.find (&c) == map_.end ())
@@ -196,7 +197,7 @@ namespace CXX
}
}
- virtual Void
+ virtual void
collect (SemanticGraph::Type& t)
{
using SemanticGraph::Type;
@@ -227,7 +228,7 @@ namespace CXX
// anyType & anySimpleType.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::AnyType& t)
{
if (fund_type (t, "any_type"))
@@ -237,7 +238,7 @@ namespace CXX
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::AnySimpleType& t)
{
fund_type (t, "any_simple_type");
@@ -245,7 +246,7 @@ namespace CXX
// Boolean.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Boolean& t)
{
fund_type (t, "boolean");
@@ -253,79 +254,79 @@ namespace CXX
// Integral types.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Byte& t)
{
fund_type (t, "byte");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::UnsignedByte& t)
{
fund_type (t, "unsigned_byte");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Short& t)
{
fund_type (t, "short");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::UnsignedShort& t)
{
fund_type (t, "unsigned_short");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Int& t)
{
fund_type (t, "int");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::UnsignedInt& t)
{
fund_type (t, "unsigned_int");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Long& t)
{
fund_type (t, "long");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::UnsignedLong& t)
{
fund_type (t, "unsigned_long");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Integer& t)
{
fund_type (t, "integer");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::NonPositiveInteger& t)
{
fund_type (t, "non_positive_integer");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::NonNegativeInteger& t)
{
fund_type (t, "non_negative_integer");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::PositiveInteger& t)
{
fund_type (t, "positive_integer");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::NegativeInteger& t)
{
fund_type (t, "negative_integer");
@@ -333,19 +334,19 @@ namespace CXX
// Floats.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Float& t)
{
fund_type (t, "float");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Double& t)
{
fund_type (t, "double");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Decimal& t)
{
fund_type (t, "decimal");
@@ -353,49 +354,49 @@ namespace CXX
// Strings.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::String& t)
{
fund_type (t, "string");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::NormalizedString& t)
{
fund_type (t, "normalized_string");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Token& t)
{
fund_type (t, "token");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::NameToken& t)
{
fund_type (t, "nmtoken");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::NameTokens& t)
{
fund_type (t, "nmtokens");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Name& t)
{
fund_type (t, "name");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::NCName& t)
{
fund_type (t, "ncname");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Language& t)
{
fund_type (t, "language");
@@ -404,7 +405,7 @@ namespace CXX
// Qualified name.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::QName& t)
{
fund_type (t, "qname");
@@ -413,19 +414,19 @@ namespace CXX
// ID/IDREF.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Id& t)
{
fund_type (t, "id");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::IdRef& t)
{
fund_type (t, "idref");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::IdRefs& t)
{
fund_type (t, "idrefs");
@@ -433,7 +434,7 @@ namespace CXX
// URI.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::AnyURI& t)
{
fund_type (t, "uri");
@@ -441,13 +442,13 @@ namespace CXX
// Binary.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Base64Binary& t)
{
fund_type (t, "base64_binary");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::HexBinary& t)
{
fund_type (t, "hex_binary");
@@ -456,55 +457,55 @@ namespace CXX
// Date/time.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Date& t)
{
fund_type (t, "date");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::DateTime& t)
{
fund_type (t, "date_time");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Duration& t)
{
fund_type (t, "duration");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Day& t)
{
fund_type (t, "day");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Month& t)
{
fund_type (t, "month");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::MonthDay& t)
{
fund_type (t, "month_day");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Year& t)
{
fund_type (t, "year");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::YearMonth& t)
{
fund_type (t, "year_month");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Time& t)
{
fund_type (t, "time");
@@ -512,20 +513,20 @@ namespace CXX
// Entity.
//
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Entity& t)
{
fund_type (t, "entity");
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Fundamental::Entities& t)
{
fund_type (t, "entities");
}
private:
- virtual Boolean
+ virtual bool
fund_type (SemanticGraph::Type& t, String const& name)
{
if (map_.find (&t) == map_.end ())
@@ -542,7 +543,7 @@ namespace CXX
{
String name (escape (raw_name + L"_s_"));
- for (UnsignedLong i (1); set_.find (name) != set_.end (); ++i)
+ for (size_t i (1); set_.find (name) != set_.end (); ++i)
{
std::wostringstream os;
os << i;
@@ -584,7 +585,7 @@ namespace CXX
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Type& t)
{
SemanticGraph::Context& tc (t.context ());
@@ -592,7 +593,7 @@ namespace CXX
if (!tc.count ("saggr"))
return;
- Boolean poly (polymorphic (t));
+ bool poly (polymorphic (t));
String const& name (tc.get<String> ("saggr"));
String pre (unclash (name, "pre"));
@@ -757,7 +758,7 @@ namespace CXX
os << "public:" << endl;
- for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ());
+ for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ());
i != end; ++i)
os << fq_name (*i->first, "s:impl") << " " << i->second << ";";
@@ -781,7 +782,7 @@ namespace CXX
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Element& e)
{
SemanticGraph::Context& ec (e.context ());
@@ -790,7 +791,7 @@ namespace CXX
return;
SemanticGraph::Type& t (e.type ());
- Boolean poly (polymorphic (t));
+ bool poly (polymorphic (t));
String const& name (ec.get<String> ("saggr"));
String pre (unclash (name, "pre"));
@@ -972,7 +973,7 @@ namespace CXX
os << "public:" << endl;
- for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ());
+ for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ());
i != end; ++i)
os << fq_name (*i->first, "s:impl") << " " << i->second << ";";
@@ -990,10 +991,10 @@ namespace CXX
};
}
- Void
+ void
generate_serializer_aggregate_header (Context& ctx)
{
- Boolean gen (false);
+ bool gen (false);
{
Traversal::Schema schema;