#include <SimpleProperties.hpp>
Inheritance diagram for SimpleProperties::Reader:

Public Member Functions | |
| virtual | ~Reader () |
| bool | first () |
| bool | next () |
| bool | valid () const |
| Uint16 | getKey () const |
| Uint16 | getValueLen () const |
| ValueType | getValueType () const |
| Uint32 | getUint32 () const |
| char * | getString (char *dst) const |
| void | printAll (NdbOut &ndbout) |
Protected Member Functions | |
| Reader () | |
| virtual void | reset ()=0 |
| virtual bool | step (Uint32 len)=0 |
| virtual bool | getWord (Uint32 *dst)=0 |
| virtual bool | peekWord (Uint32 *dst) const =0 |
| virtual bool | peekWords (Uint32 *dst, Uint32 len) const =0 |
Private Member Functions | |
| bool | readValue () |
Private Attributes | |
| Uint16 | m_key |
| Uint16 | m_itemLen |
| union { | |
| Uint32 m_ui32_value | |
| Uint32 m_strLen | |
| }; | |
| ValueType | m_type |
Definition at line 93 of file SimpleProperties.hpp.
| virtual SimpleProperties::Reader::~Reader | ( | ) | [inline, virtual] |
| SimpleProperties::Reader::Reader | ( | ) | [protected] |
Definition at line 90 of file SimpleProperties.cpp.
References m_itemLen.
00090 { 00091 m_itemLen = 0; 00092 }
| bool SimpleProperties::Reader::first | ( | ) |
Move to first element Return true if element exist
Definition at line 95 of file SimpleProperties.cpp.
References m_itemLen, readValue(), and reset().
Referenced by Dbdict::createEvent_RT_USER_CREATE(), Dbdict::createEvent_RT_USER_GET(), Dbdict::execDROP_EVNT_REQ(), Dbdict::handleTabInfoInit(), operator<<(), Restore::parse_table_description(), Backup::parseTableDescription(), and printAll().
Here is the call graph for this function:

Here is the caller graph for this function:

| Uint16 SimpleProperties::Reader::getKey | ( | ) | const |
Get key Note only valid is valid() == true
Definition at line 112 of file SimpleProperties.cpp.
References m_key.
Referenced by Dbdict::execCREATE_TRIG_REQ(), Dbdict::execDROP_TRIG_REQ(), Dbdict::handleTabInfo(), Dbdict::handleTabInfoInit(), operator<<(), DbUtil::prepareOperation(), printAll(), and SimpleProperties::unpack().
00112 { 00113 return m_key; 00114 }
Here is the caller graph for this function:

| char * SimpleProperties::Reader::getString | ( | char * | dst | ) | const |
Definition at line 141 of file SimpleProperties.cpp.
References m_itemLen, and peekWords().
Referenced by Dbdict::createEvent_RT_USER_CREATE(), Dbdict::createEvent_RT_USER_GET(), Dbdict::execCREATE_TRIG_REQ(), Dbdict::execDROP_EVNT_REQ(), Dbdict::execDROP_TRIG_REQ(), operator<<(), DbUtil::prepareOperation(), printAll(), and SimpleProperties::unpack().
Here is the call graph for this function:

Here is the caller graph for this function:

| Uint32 SimpleProperties::Reader::getUint32 | ( | ) | const |
Get value Note only valid is valid() == true
Definition at line 136 of file SimpleProperties.cpp.
References m_ui32_value.
Referenced by operator<<(), DbUtil::prepareOperation(), printAll(), and SimpleProperties::unpack().
00136 { 00137 return m_ui32_value; 00138 }
Here is the caller graph for this function:

| Uint16 SimpleProperties::Reader::getValueLen | ( | ) | const |
Get value length in bytes - (including terminating 0 for strings) Note only valid is valid() == true
Definition at line 117 of file SimpleProperties.cpp.
References SimpleProperties::BinaryValue, SimpleProperties::InvalidValue, m_strLen, m_type, SimpleProperties::StringValue, and SimpleProperties::Uint32Value.
Referenced by Dbdict::createEvent_RT_USER_CREATE(), Dbdict::createEvent_RT_USER_GET(), Dbdict::execDROP_EVNT_REQ(), operator<<(), DbUtil::prepareOperation(), printAll(), and SimpleProperties::unpack().
00117 { 00118 switch(m_type){ 00119 case Uint32Value: 00120 return 4; 00121 case StringValue: 00122 case BinaryValue: 00123 return m_strLen; 00124 case InvalidValue: 00125 return 0; 00126 } 00127 return 0; 00128 }
Here is the caller graph for this function:

| SimpleProperties::ValueType SimpleProperties::Reader::getValueType | ( | ) | const |
Get value type Note only valid is valid() == true
Definition at line 131 of file SimpleProperties.cpp.
References m_type.
Referenced by Dbdict::createEvent_RT_USER_CREATE(), Dbdict::createEvent_RT_USER_GET(), Dbdict::execDROP_EVNT_REQ(), operator<<(), printAll(), and SimpleProperties::unpack().
00131 { 00132 return m_type; 00133 }
Here is the caller graph for this function:

Implemented in SimplePropertiesLinearReader, and SimplePropertiesSectionReader.
Referenced by readValue().
Here is the caller graph for this function:

| bool SimpleProperties::Reader::next | ( | ) |
Move to next element Return true if element exist
Definition at line 102 of file SimpleProperties.cpp.
References readValue().
Referenced by Dbdict::createEvent_RT_USER_CREATE(), Dbdict::handleTabInfo(), operator<<(), Restore::parse_table_description(), Backup::parseTableDescription(), NdbDictInterface::parseTableInfo(), DbUtil::prepareOperation(), printAll(), and SimpleProperties::unpack().
00102 { 00103 return readValue(); 00104 }
Here is the call graph for this function:

Here is the caller graph for this function:

Implemented in SimplePropertiesLinearReader, and SimplePropertiesSectionReader.
Referenced by readValue().
Here is the caller graph for this function:

| virtual bool SimpleProperties::Reader::peekWords | ( | Uint32 * | dst, | |
| Uint32 | len | |||
| ) | const [protected, pure virtual] |
Implemented in SimplePropertiesLinearReader, and SimplePropertiesSectionReader.
Referenced by getString().
Here is the caller graph for this function:

| void SimpleProperties::Reader::printAll | ( | NdbOut & | ndbout | ) |
Print the complete simple properties (for debugging)
Definition at line 293 of file SimpleProperties.cpp.
References SimpleProperties::BinaryValue, first(), getKey(), getString(), getUint32(), getValueLen(), getValueType(), next(), SimpleProperties::StringValue, SimpleProperties::Uint32Value, and valid().
Referenced by Dbdict::createEvent_RT_USER_CREATE(), Dbdict::createEvent_RT_USER_GET(), Dbdict::execDROP_EVNT_REQ(), and reader().
00293 { 00294 char tmp[1024]; 00295 for(first(); valid(); next()){ 00296 switch(getValueType()){ 00297 case SimpleProperties::Uint32Value: 00298 ndbout << "Key: " << getKey() 00299 << " value(" << getValueLen() << ") : " 00300 << getUint32() << endl; 00301 break; 00302 case SimpleProperties::BinaryValue: 00303 case SimpleProperties::StringValue: 00304 if(getValueLen() < 1024){ 00305 getString(tmp); 00306 ndbout << "Key: " << getKey() 00307 << " value(" << getValueLen() << ") : " 00308 << "\"" << tmp << "\"" << endl; 00309 } else { 00310 ndbout << "Key: " << getKey() 00311 << " value(" << getValueLen() << ") : " 00312 << "\"" << "<TOO LONG>" << "\"" << endl; 00313 00314 } 00315 break; 00316 default: 00317 ndbout << "Unknown type for key: " << getKey() 00318 << " type: " << (Uint32)getValueType() << endl; 00319 } 00320 } 00321 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool SimpleProperties::Reader::readValue | ( | ) | [private] |
Definition at line 148 of file SimpleProperties.cpp.
References SimpleProperties::BinaryValue, getWord(), SimpleProperties::InvalidValue, m_itemLen, m_key, m_strLen, m_type, m_ui32_value, peekWord(), step(), SimpleProperties::StringValue, and SimpleProperties::Uint32Value.
Referenced by first(), and next().
00148 { 00149 if(!step(m_itemLen)){ 00150 m_type = InvalidValue; 00151 return false; 00152 } 00153 00154 Uint32 tmp; 00155 if(!getWord(&tmp)){ 00156 m_type = InvalidValue; 00157 return false; 00158 } 00159 00160 tmp = ntohl(tmp); 00161 m_key = tmp & 0xFFFF; 00162 m_type = (SimpleProperties::ValueType)(tmp >> 16); 00163 switch(m_type){ 00164 case Uint32Value: 00165 m_itemLen = 1; 00166 if(!peekWord(&m_ui32_value)) 00167 return false; 00168 m_ui32_value = ntohl(m_ui32_value); 00169 return true; 00170 case StringValue: 00171 case BinaryValue: 00172 if(!getWord(&tmp)) 00173 return false; 00174 m_strLen = ntohl(tmp); 00175 m_itemLen = (m_strLen + 3)/4; 00176 return true; 00177 default: 00178 m_itemLen = 0; 00179 m_type = InvalidValue; 00180 return false; 00181 } 00182 }
Here is the call graph for this function:

Here is the caller graph for this function:

| virtual void SimpleProperties::Reader::reset | ( | ) | [protected, pure virtual] |
Implemented in SimplePropertiesLinearReader, and SimplePropertiesSectionReader.
Referenced by first().
Here is the caller graph for this function:

Implemented in SimplePropertiesLinearReader, and SimplePropertiesSectionReader.
Referenced by readValue().
Here is the caller graph for this function:

| bool SimpleProperties::Reader::valid | ( | ) | const |
Is this valid
Definition at line 107 of file SimpleProperties.cpp.
References SimpleProperties::InvalidValue, and m_type.
Referenced by operator<<(), printAll(), and SimpleProperties::unpack().
00107 { 00108 return m_type != InvalidValue; 00109 }
Here is the caller graph for this function:

union { ... } [private] |
Uint16 SimpleProperties::Reader::m_itemLen [private] |
Definition at line 148 of file SimpleProperties.hpp.
Referenced by first(), getString(), Reader(), and readValue().
Uint16 SimpleProperties::Reader::m_key [private] |
Uint32 SimpleProperties::Reader::m_strLen [private] |
ValueType SimpleProperties::Reader::m_type [private] |
Definition at line 153 of file SimpleProperties.hpp.
Referenced by getValueLen(), getValueType(), readValue(), and valid().
Uint32 SimpleProperties::Reader::m_ui32_value [private] |
1.4.7

