Make some of the class names in BaseBuffer more accurate.
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
//
|
||||
// LuaValueHolder
|
||||
// BaseLuaValue
|
||||
//
|
||||
// A struct that holds a dynamically typed value.
|
||||
// This can hold a string, token, number, vector, or boolean.
|
||||
@@ -42,13 +42,13 @@ enum class LuaValueType {
|
||||
};
|
||||
|
||||
template<class STRING>
|
||||
struct LuaValueHolder {
|
||||
struct BaseLuaValue {
|
||||
using string = STRING;
|
||||
LuaValueType type;
|
||||
double x, y, z;
|
||||
string s;
|
||||
|
||||
LuaValueHolder() {
|
||||
BaseLuaValue() {
|
||||
type = LuaValueType::UNINITIALIZED;
|
||||
x=y=z=0;
|
||||
}
|
||||
@@ -93,7 +93,7 @@ struct LuaValueHolder {
|
||||
type = LuaValueType::VECTOR; s.clear(); x=ix; y=iy; z=iz;
|
||||
}
|
||||
|
||||
void copy_value(const LuaValueHolder &other) {
|
||||
void copy_value(const BaseLuaValue &other) {
|
||||
type = other.type;
|
||||
s=other.s; x=other.x; y=other.y; z=other.z;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ struct LuaValueHolder {
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BaseWriter
|
||||
// BaseWriteMethods
|
||||
//
|
||||
// This base class provides the following methods:
|
||||
//
|
||||
@@ -119,9 +119,9 @@ struct LuaValueHolder {
|
||||
// void write_length(size_t data)
|
||||
// void write_string(std::string_view data)
|
||||
//
|
||||
// You should derive from BaseWriter using the CRTP pattern:
|
||||
// You should derive from BaseWriteMethods using the CRTP pattern:
|
||||
//
|
||||
// class DerivedWriter : public BaseWriter<DerivedWriter>
|
||||
// class DerivedWriter : public BaseWriteMethods<DerivedWriter>
|
||||
//
|
||||
// You must provide two methods in the derived class:
|
||||
//
|
||||
@@ -131,7 +131,7 @@ struct LuaValueHolder {
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
template<class Derived>
|
||||
class BaseWriter {
|
||||
class BaseWriteMethods {
|
||||
protected:
|
||||
template<class T>
|
||||
void write_value_core(T arg) {
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BaseReader
|
||||
// BaseReadMethods
|
||||
//
|
||||
// This base class provides the following methods:
|
||||
//
|
||||
@@ -199,9 +199,9 @@ public:
|
||||
// String read_string_limit(uint64_t size);
|
||||
// String read_string();
|
||||
//
|
||||
// You should derive from BaseReader using the CRTP pattern:
|
||||
// You should derive from BaseReadMethods using the CRTP pattern:
|
||||
//
|
||||
// class DerivedReader : public BaseReader<DerivedReader>
|
||||
// class DerivedReader : public BaseReadMethods<DerivedReader>
|
||||
//
|
||||
// The derived class must provide:
|
||||
//
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
template<class Derived>
|
||||
class BaseReader {
|
||||
class BaseReadMethods {
|
||||
protected:
|
||||
template<class T>
|
||||
T read_value_core() {
|
||||
@@ -502,13 +502,13 @@ public:
|
||||
write_uint8(uint8_t(tag));
|
||||
}
|
||||
|
||||
// Write a LuaValueHolder value.
|
||||
// Write a BaseLuaValue value.
|
||||
//
|
||||
// This works regardless of what kind of data is present in the
|
||||
// LuaValueHolder.
|
||||
// BaseLuaValue.
|
||||
//
|
||||
template<class STRING>
|
||||
void write_simple_dynamic(const LuaValueHolder<STRING> &sd) {
|
||||
void write_simple_dynamic(const BaseLuaValue<STRING> &sd) {
|
||||
write_simple_dynamic_tag(sd.type);
|
||||
switch(sd.type) {
|
||||
case LuaValueType::STRING: write_string(sd.s); break;
|
||||
@@ -626,10 +626,10 @@ public:
|
||||
return LuaValueType(read_uint8());
|
||||
}
|
||||
|
||||
// Read a LuaValueHolder
|
||||
// Read a BaseLuaValue
|
||||
//
|
||||
template<class STRING>
|
||||
void read_simple_dynamic(LuaValueHolder<STRING> *result) {
|
||||
void read_simple_dynamic(BaseLuaValue<STRING> *result) {
|
||||
LuaValueType type = read_simple_dynamic_tag();
|
||||
switch (type) {
|
||||
case LuaValueType::STRING: result->set_string(read_string()); break;
|
||||
|
||||
Reference in New Issue
Block a user