aboutsummaryrefslogtreecommitdiff
path: root/xsde/cxx/hybrid/serializer-aggregate-source.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xsde/cxx/hybrid/serializer-aggregate-source.cxx')
-rw-r--r--xsde/cxx/hybrid/serializer-aggregate-source.cxx76
1 files changed, 37 insertions, 39 deletions
diff --git a/xsde/cxx/hybrid/serializer-aggregate-source.cxx b/xsde/cxx/hybrid/serializer-aggregate-source.cxx
index e9edeea..ef7ff76 100644
--- a/xsde/cxx/hybrid/serializer-aggregate-source.cxx
+++ b/xsde/cxx/hybrid/serializer-aggregate-source.cxx
@@ -9,8 +9,6 @@
#include <xsd-frontend/semantic-graph.hxx>
#include <xsd-frontend/traversal.hxx>
-#include <cult/containers/map.hxx>
-
namespace CXX
{
namespace Hybrid
@@ -21,8 +19,8 @@ namespace CXX
{
ParticleArg (Context& c,
TypeInstanceMap& map,
- Boolean& first,
- Boolean poly,
+ bool& first,
+ bool poly,
String const& arg)
: Context (c),
poly_ (poly),
@@ -33,7 +31,7 @@ namespace CXX
{
}
- ParticleArg (Context& c, Boolean& result, Boolean poly)
+ ParticleArg (Context& c, bool& result, bool poly)
: Context (c),
poly_ (poly),
map_ (0),
@@ -42,7 +40,7 @@ namespace CXX
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Element& e)
{
if (poly_ && anonymous (e.type ()))
@@ -66,26 +64,26 @@ namespace CXX
}
private:
- Boolean poly_;
+ bool poly_;
TypeInstanceMap* map_;
- Boolean* first_;
- Boolean* result_;
+ bool* first_;
+ bool* result_;
String arg_;
};
struct AttributeArg: Traversal::Attribute, Context
{
- AttributeArg (Context& c, TypeInstanceMap& map, Boolean& first)
+ AttributeArg (Context& c, TypeInstanceMap& map, bool& first)
: Context (c), map_ (&map), first_ (&first), result_ (0)
{
}
- AttributeArg (Context& c, Boolean& result)
+ AttributeArg (Context& c, bool& result)
: Context (c), map_ (0), first_ (0), result_ (&result)
{
}
- virtual Void
+ virtual void
traverse (Type& a)
{
if (result_ != 0)
@@ -104,8 +102,8 @@ namespace CXX
private:
TypeInstanceMap* map_;
- Boolean* first_;
- Boolean* result_;
+ bool* first_;
+ bool* result_;
};
struct ArgList : Traversal::Complex,
@@ -114,7 +112,7 @@ namespace CXX
{
ArgList (Context& c,
TypeInstanceMap& map,
- Boolean poly,
+ bool poly,
String const& arg)
: Context (c),
poly_ (poly),
@@ -135,7 +133,7 @@ namespace CXX
names_ >> attribute_;
}
- ArgList (Context& c, Boolean& result, Boolean poly)
+ ArgList (Context& c, bool& result, bool poly)
: Context (c),
poly_ (poly),
map_ (0),
@@ -154,7 +152,7 @@ namespace CXX
names_ >> attribute_;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& c)
{
inherits (c, inherits_);
@@ -166,7 +164,7 @@ namespace CXX
}
}
- virtual Void
+ virtual void
traverse (SemanticGraph::List& l)
{
if (poly_)
@@ -187,7 +185,7 @@ namespace CXX
}
private:
- Boolean poly_;
+ bool poly_;
TypeInstanceMap* map_;
Traversal::Inherits inherits_;
@@ -200,8 +198,8 @@ namespace CXX
Traversal::Names names_;
AttributeArg attribute_;
- Boolean first_;
- Boolean* result_;
+ bool first_;
+ bool* result_;
};
struct SerializerConnect: Traversal::List,
@@ -210,13 +208,13 @@ namespace CXX
{
SerializerConnect (Context& c,
TypeInstanceMap& map,
- Boolean poly,
+ bool poly,
String const& map_inst = String ())
: Context (c), poly_ (poly), map_ (map), map_inst_ (map_inst)
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::List& l)
{
if (poly_)
@@ -227,7 +225,7 @@ namespace CXX
<< endl;
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Complex& c)
{
if (has_members (c))
@@ -244,17 +242,17 @@ namespace CXX
}
private:
- Boolean
+ bool
has_members (SemanticGraph::Complex& c)
{
- Boolean r (false);
+ bool r (false);
ArgList test (*this, r, poly_);
test.traverse (c);
return r;
}
private:
- Boolean poly_;
+ bool poly_;
TypeInstanceMap& map_;
String map_inst_;
};
@@ -268,7 +266,7 @@ namespace CXX
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Type& t)
{
SemanticGraph::Context& tc (t.context ());
@@ -310,9 +308,9 @@ namespace CXX
String const& entry (
tc.get<String> ("saggr-serializer-map-entries"));
- Size n (0);
+ size_t n (0);
- for (TypeIdInstanceMap::Iterator i (tid_map->begin ());
+ for (TypeIdInstanceMap::iterator i (tid_map->begin ());
i != tid_map->end ();
++i, ++n)
{
@@ -328,7 +326,7 @@ namespace CXX
//
SerializerConnect connect (*this, map, false);
- for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ());
+ for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ());
i != end; ++i)
connect.dispatch (*i->first);
@@ -339,7 +337,7 @@ namespace CXX
SerializerConnect connect (
*this, map, true, tc.get<String> ("saggr-serializer-map"));
- for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ());
+ for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ());
i != end; ++i)
connect.dispatch (*i->first);
}
@@ -355,7 +353,7 @@ namespace CXX
{
}
- virtual Void
+ virtual void
traverse (SemanticGraph::Element& e)
{
SemanticGraph::Context& ec (e.context ());
@@ -397,9 +395,9 @@ namespace CXX
String const& entry (
ec.get<String> ("saggr-serializer-map-entries"));
- Size n (0);
+ size_t n (0);
- for (TypeIdInstanceMap::Iterator i (tid_map->begin ());
+ for (TypeIdInstanceMap::iterator i (tid_map->begin ());
i != tid_map->end ();
++i, ++n)
{
@@ -415,7 +413,7 @@ namespace CXX
//
SerializerConnect connect (*this, map, false);
- for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ());
+ for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ());
i != end; ++i)
connect.dispatch (*i->first);
@@ -426,7 +424,7 @@ namespace CXX
SerializerConnect connect (
*this, map, true, ec.get<String> ("saggr-serializer-map"));
- for (TypeInstanceMap::Iterator i (map.begin ()), end (map.end ());
+ for (TypeInstanceMap::iterator i (map.begin ()), end (map.end ());
i != end; ++i)
connect.dispatch (*i->first);
}
@@ -456,10 +454,10 @@ namespace CXX
};
}
- Void
+ void
generate_serializer_aggregate_source (Context& ctx)
{
- Boolean gen (false);
+ bool gen (false);
{
Traversal::Schema schema;