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10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /externals/g4tools/include/tools/sg/field (Version 11.3.0) and /externals/g4tools/include/tools/sg/field (Version 5.2.p1)


  1 // Copyright (C) 2010, Guy Barrand. All rights    
  2 // See the file tools.license for terms.          
  3                                                   
  4 #ifndef tools_sg_field                            
  5 #define tools_sg_field                            
  6                                                   
  7 #include <ostream>                                
  8                                                   
  9 #include "../scast"                               
 10 #include "../S_STRING"                            
 11                                                   
 12 #ifdef TOOLS_MEM                                  
 13 #include "../mem"                                 
 14 #endif                                            
 15                                                   
 16 namespace tools {                                 
 17 namespace io {                                    
 18 class iwbuf;                                      
 19 class irbuf;                                      
 20 }}                                                
 21                                                   
 22 namespace tools {                                 
 23 namespace sg {                                    
 24                                                   
 25 class field {                                     
 26 public:                                           
 27   TOOLS_SCLASS(tools::sg::field)                  
 28   virtual void* cast(const std::string& a_clas    
 29     if(void* p = cmp_cast<field>(this,a_class)    
 30     else return 0;                                
 31   }                                               
 32   virtual const std::string& s_cls() const = 0    
 33 public:                                           
 34   virtual bool write(io::iwbuf&) = 0;             
 35   virtual bool read(io::irbuf&) = 0;              
 36   virtual bool dump(std::ostream&) = 0;           
 37   virtual bool s_value(std::string&) const = 0    
 38   virtual bool s2value(const std::string&) = 0    
 39 protected:                                        
 40   field():m_touched(true){                        
 41 #ifdef TOOLS_MEM                                  
 42     mem::increment(s_class().c_str());            
 43 #endif                                            
 44   }                                               
 45 public:                                           
 46   virtual ~field(){                               
 47 #ifdef TOOLS_MEM                                  
 48     mem::decrement(s_class().c_str());            
 49 #endif                                            
 50   }                                               
 51 protected:                                        
 52   field(const field&):m_touched(true){            
 53 #ifdef TOOLS_MEM                                  
 54     mem::increment(s_class().c_str());            
 55 #endif                                            
 56   }                                               
 57   field& operator=(const field&){m_touched=fal    
 58 public:                                           
 59   void touch() {m_touched = true;}                
 60   bool touched() const {return m_touched;}        
 61   void reset_touched() {m_touched = false;}       
 62 protected:                                        
 63   bool m_touched;                                 
 64 };                                                
 65                                                   
 66 }}                                                
 67                                                   
 68 #define TOOLS_FIELD_DESC_NODE_CLASS(a__class)     
 69   static const std::string s_node_class(#a__cl    
 70                                                   
 71 #define TOOLS_ARG_FIELD_DESC(a__field) \          
 72   new tools::sg::field_desc(s_node_class+"."+#    
 73                                                   
 74 #define TOOLS_ARG_FIELD_DESC_NOT_EDITABLE(a__f    
 75   new tools::sg::field_desc(s_node_class+"."+#    
 76                                                   
 77 #define TOOLS_ARG_FIELD_DESC_ENUMS_BEG(a__fiel    
 78   new tools::sg::field_desc_enums(s_node_class    
 79 #define TOOLS_ARG_FIELD_DESC_ENUMS_END )          
 80                                                   
 81 #define TOOLS_ARG_FIELD_DESC_NOT_EDITABLE_ENUM    
 82   new tools::sg::field_desc_enums(s_node_class    
 83 #define TOOLS_ARG_FIELD_DESC_ENUMS_END )          
 84                                                   
 85 #define TOOLS_ARG_ENUM(a__value) #a__value,a__    
 86                                                   
 87 #define TOOLS_ARG_FIELD_DESC_OPTS_BEG(a__field    
 88   new tools::sg::field_desc_opts(s_node_class+    
 89 #define TOOLS_ARG_FIELD_DESC_OPTS_END )           
 90                                                   
 91 #endif                                            
 92