diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-03-18 22:23:37 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2007-03-18 22:23:37 +0000 |
commit | 06a34455bd98b1379cc69bbc5b2cf085e0fc0d9b (patch) | |
tree | 8815ce3b3a85c3c4285429295f338e00ea4497f4 /CIAO/tools/Config_Handlers/XSCRT/Writer.hpp | |
parent | d66fcc9b4aaec8e88eeb83fc578fdf8a3cc963de (diff) | |
download | ATCD-Static_RT_DAnCE.tar.gz |
Diffstat (limited to 'CIAO/tools/Config_Handlers/XSCRT/Writer.hpp')
-rw-r--r-- | CIAO/tools/Config_Handlers/XSCRT/Writer.hpp | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/CIAO/tools/Config_Handlers/XSCRT/Writer.hpp b/CIAO/tools/Config_Handlers/XSCRT/Writer.hpp new file mode 100644 index 00000000000..6fdd82f6f3e --- /dev/null +++ b/CIAO/tools/Config_Handlers/XSCRT/Writer.hpp @@ -0,0 +1,81 @@ +// file : XSCRT/Writer.hpp +// author : Boris Kolpackov <boris@dre.vanderbilt.edu> +// cvs-id : $Id$ + +#ifndef XSCRT_WRITER_HPP +#define XSCRT_WRITER_HPP + +#include <stack> +#include <string> + +#include "XSCRT/XML.hpp" + +namespace XSCRT +{ + template <typename C> + class Writer + { + public: + Writer (XML::Element<C>& e) + : attr__ (0) + { + push_ (e); + } + + protected: + // This c-tor should never be called. + // + Writer () + { + abort (); + } + + public: + void + push_ (XML::Element<C> const& e) + { + stack_.push (e); + } + + void + pop_ () + { + stack_.pop (); + } + + XML::Element<C>& + top_ () + { + return stack_.top (); + } + + public: + XML::Attribute<C>* + attr_ () + { + return attr__; + } + + void + attr_ (XML::Attribute<C>* a) + { + attr__ = a; + } + + private: + std::stack<XML::Element<C> > stack_; + + XML::Attribute<C>* attr__; + + private: + Writer (Writer const&); + + void + operator= (Writer const&); + }; +} + +#include <XSCRT/Writer.ipp> +#include <XSCRT/Writer.tpp> + +#endif // XSCRT_WRITER_HPP |