Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights 1 // Copyright (C) 2010, Guy Barrand. All rights reserved. 2 // See the file tools.license for terms. 2 // See the file tools.license for terms. 3 3 4 #ifndef tools_sg_write_action 4 #ifndef tools_sg_write_action 5 #define tools_sg_write_action 5 #define tools_sg_write_action 6 6 7 #include "action" 7 #include "action" 8 8 9 namespace tools { 9 namespace tools { 10 namespace sg { 10 namespace sg { 11 class node; 11 class node; 12 }} 12 }} 13 namespace tools { 13 namespace tools { 14 namespace io { 14 namespace io { 15 class iwbuf; 15 class iwbuf; 16 }} 16 }} 17 17 18 namespace tools { 18 namespace tools { 19 namespace sg { 19 namespace sg { 20 20 21 class write_action : public action { 21 class write_action : public action { 22 TOOLS_ACTION_NO_COPY(write_action,tools::sg: 22 TOOLS_ACTION_NO_COPY(write_action,tools::sg::write_action,action) 23 public: 23 public: 24 virtual io::iwbuf& buffer() = 0; 24 virtual io::iwbuf& buffer() = 0; 25 virtual bool beg_node(const node&) = 0; 25 virtual bool beg_node(const node&) = 0; 26 virtual bool end_node(const node&) = 0; 26 virtual bool end_node(const node&) = 0; 27 27 28 virtual bool switch_do_all_children() {retur 28 virtual bool switch_do_all_children() {return true;} 29 virtual unsigned int protocol() const = 0; 29 virtual unsigned int protocol() const = 0; 30 public: 30 public: 31 write_action(std::ostream& a_out) 31 write_action(std::ostream& a_out) 32 :parent(a_out){} 32 :parent(a_out){} 33 virtual ~write_action(){} 33 virtual ~write_action(){} 34 protected: 34 protected: 35 write_action(const write_action& a_from) 35 write_action(const write_action& a_from) 36 :parent(a_from) 36 :parent(a_from) 37 {} 37 {} 38 write_action& operator=(const write_action& 38 write_action& operator=(const write_action& a_from){ 39 parent::operator=(a_from); 39 parent::operator=(a_from); 40 return *this; 40 return *this; 41 } 41 } 42 }; 42 }; 43 43 44 }} 44 }} 45 45 46 #endif 46 #endif