// file : odb/semantics/relational/column.cxx // copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC // license : GNU GPL v3; see accompanying LICENSE file #include #include namespace semantics { namespace relational { column:: column (column const& c, uscope&, graph& g) : unameable (c, g), type_ (c.type_), null_ (c.null_), default__ (c.default__), options_ (c.options_) { } column:: column (xml::parser& p, uscope&, graph& g) : unameable (p, g), type_ (p.attribute ("type", string ())), null_ (p.attribute ("null")), default__ (p.attribute ("default", string ())), options_ (p.attribute ("options", string ())) { p.content (xml::parser::empty); } column& column:: clone (uscope& s, graph& g) const { return g.new_node (*this, s, g); } void column:: serialize (xml::serializer& s) const { s.start_element (xmlns, "column"); unameable::serialize_attributes (s); s.attribute ("type", type ()); s.attribute ("null", null ()); // Output even if false. if (!default_ ().empty ()) s.attribute ("default", default_ ()); if (!options ().empty ()) s.attribute ("options", options ()); s.end_element (); } // type info // namespace { struct init { init () { unameable::parser_map_["column"] = &unameable::parser_impl; using compiler::type_info; { type_info ti (typeid (column)); ti.add_base (typeid (unameable)); insert (ti); } } } init_; } } }