Import Geant4 10.4.0 source tree
This commit is contained in:
@@ -31,8 +31,13 @@ public:
|
||||
if(void* p = cmp_cast<base_leaf>(this,a_class)) {return p;}
|
||||
else return 0;
|
||||
}
|
||||
virtual cid id_cls() const {return id_class();}
|
||||
public: //ibo
|
||||
virtual bool stream(buffer& a_buffer) const {
|
||||
//::printf("debug : base_leaf::stream %s\n",m_name.c_str());
|
||||
//::printf("debug : m_length %d\n",m_length);
|
||||
//::printf("debug : m_is_range %d\n",m_is_range);
|
||||
//::printf("debug : m_leaf_count %lu\n",m_leaf_count);
|
||||
unsigned int c;
|
||||
if(!a_buffer.write_version(2,c)) return false;
|
||||
if(!Named_stream(a_buffer,m_name,m_title)) return false;
|
||||
@@ -40,13 +45,15 @@ public: //ibo
|
||||
if(!a_buffer.write(m_length_type)) return false;
|
||||
uint32 fOffset = 0;
|
||||
if(!a_buffer.write(fOffset)) return false;
|
||||
bool fIsRange = false;
|
||||
if(!a_buffer.write(fIsRange)) return false;
|
||||
if(!a_buffer.write(m_is_range)) return false;
|
||||
bool fIsUnsigned = false;
|
||||
if(!a_buffer.write(fIsUnsigned)) return false;
|
||||
|
||||
//if(!a_buffer.write_object(m_leaf_count)) return false;
|
||||
if(!a_buffer.write(kNullTag())) return false;
|
||||
if(m_leaf_count) {
|
||||
if(!a_buffer.write_object(*m_leaf_count)) return false;
|
||||
} else {
|
||||
if(!a_buffer.write(kNullTag())) return false;
|
||||
}
|
||||
|
||||
if(!a_buffer.set_byte_count(c)) return false;
|
||||
return true;
|
||||
@@ -61,6 +68,8 @@ public:
|
||||
|
||||
,m_length(0)
|
||||
,m_length_type(0)
|
||||
,m_leaf_count(0)
|
||||
,m_is_range(false)
|
||||
{
|
||||
#ifdef TOOLS_MEM
|
||||
mem::increment(s_class().c_str());
|
||||
@@ -75,13 +84,19 @@ protected:
|
||||
base_leaf(const base_leaf& a_from)
|
||||
:ibo(a_from)
|
||||
,m_out(a_from.m_out)
|
||||
,m_length(0)
|
||||
,m_length_type(0)
|
||||
,m_leaf_count(0)
|
||||
,m_is_range(false)
|
||||
{}
|
||||
base_leaf& operator=(const base_leaf&){return *this;}
|
||||
public:
|
||||
const std::string& name() const {return m_name;}
|
||||
//const std::string& title() const {return m_title;}
|
||||
void set_title(const std::string& a_value) {m_title = a_value;}
|
||||
uint32 length() const {return m_length;}
|
||||
void set_length(uint32 a_value) {m_length = a_value;}
|
||||
void set_is_range(bool a_value) {m_is_range = a_value;}
|
||||
protected:
|
||||
std::ostream& m_out;
|
||||
protected: //Named
|
||||
@@ -89,6 +104,8 @@ protected: //Named
|
||||
std::string m_title;
|
||||
uint32 m_length; // Number of fixed length elements
|
||||
uint32 m_length_type; // Number of bytes for this data type
|
||||
ibo* m_leaf_count;
|
||||
bool m_is_range;
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user