3#ifndef STREAMBASE_FIELDVALUE_HPP
4#define STREAMBASE_FIELDVALUE_HPP
6#include "StreamBase.hpp"
7#include "CompleteDataType.hpp"
8#include "Timestamp.hpp"
30#ifndef DOXYGEN_INTERNAL_ONLY
38#ifndef DOXYGEN_INTERNAL_ONLY
85 bool operator==(
const FieldValue& t)
const {
return compare(t) == 0; }
86 bool operator!=(
const FieldValue& t)
const {
return compare(t) != 0; }
87 bool operator<(
const FieldValue& t)
const {
return compare(t) < 0; }
88 bool operator>(
const FieldValue& t)
const {
return compare(t) > 0; }
89 bool operator<=(
const FieldValue& t)
const {
return compare(t) <= 0; }
90 bool operator>=(
const FieldValue& t)
const {
return compare(t) >= 0; }
112#ifndef DOXYGEN_INTERNAL_ONLY
113 size_t getSize()
const;
126#ifndef DOXYGEN_INTERNAL_ONLY
127 std::string toDelimitedString(
const std::string& delimiter,
128 const std::string& null_string,
130 bool quote_all_strings)
const;
132 std::string toCSVString(
char delim,
const std::string& null_string,
char quote)
const;
187 const std::vector<FieldValue>&
getList()
const;
191 void setNull(
bool value =
true);
194 void setBool(
bool value);
197 void setInt(
int value);
200 void setDouble(
double value);
203 void setLong(
long long value);
207 long long getTimestampLong()
const;
209 void setTimestamp(
const Timestamp& value);
211 void setTimestampLong(
long long value);
214 void setString(
const std::string& value);
217 void setBlob(
const std::string& value);
221 const std::string& getVarLength()
const;
224 void setTuple(
const Tuple& value);
227 void setFunction(
const Function& value);
231 void setList(
const CompleteDataType& elemType,
const std::vector<FieldValue>& value);
235 void setList(
const std::vector<FieldValue>& value);
258 std::vector<FieldValue> elems;
264 Function* function_value;
270 std::string _captureName;
272 void verifyCheck(
const DataType& type)
const;
275 friend class sb_internal::SchemaUtil;
277 friend struct TuplePrivateImpl;
An object containing all the information about a data type – the primitive DataType; for DataType::TU...
Definition: CompleteDataType.hpp:29
A type of data in a tuple.
Definition: DataType.hpp:29
A value a Field may take on.
Definition: FieldValue.hpp:28
FieldValue(const DataType &type, const CompleteDataType &elemType)
Create an empty list of the specified element type.
bool sameType(const FieldValue &fv) const
Returns true if this FieldValue and the provided FieldValue are of the same type.
FieldValue(const Timestamp &value)
DataType::TIMESTAMP constructor.
int getInt() const
Return the value of an integer FieldValue.
int compare(const FieldValue &fv) const
Compare the current FieldValue against the provided FieldValue.
bool getBool() const
Return the value of a boolean FieldValue.
FieldValue(const Function &value)
DataType::FUNCTION constructor.
FieldValue(bool value)
DataType::BOOL constructor.
const std::string & getString() const
Return the value of a string FieldValue.
FieldValue(double value)
DataType::DOUBLE constructor.
const std::vector< FieldValue > & getList() const
Return the value of a List FieldValue.
FieldValue(long long value)
DataType::LONG constructor.
std::string as_string() const
Return a string representation of this FieldValue.
const std::string & getBlob() const
Return the value of a blob FieldValue as a string.
Timestamp getTimestamp() const
Return the value of a Timestamp FieldValue as a Timestamp.
FieldValue(const DataType &type, const std::string &value)
DataType::STRING, DataType::BLOB, and DataType::CAPTURE constructor.
long long getLong() const
Return the value of a long FieldValue.
Tuple & getTuple()
Return the value of a Tuple FieldValue as a mutable Tuple.
FieldValue(int value)
DataType::INT constructor.
const FieldValue & operator=(const FieldValue &fv)
Assignment operator.
FieldValue(const std::string &value)
DataType::STRING constructor.
FieldValue(const Tuple &value)
DataType::TUPLE constructor.
bool isNull() const
Return true if this FieldValue represents a null value.
double getDouble() const
Return the value of a double FieldValue.
const Tuple & getTuple() const
Return the value of a Tuple FieldValue.
const DataType & getType() const
Get the primitive DataType of this FieldValue.
FieldValue(const char *value)
DataType::STRING constructor.
const std::string & getCapture() const
Return the value of a Capture FieldValue, as a string Will throw an exception if this FieldValue is n...
FieldValue(const FieldValue &fv)
Copy constructor.
FieldValue(const std::vector< FieldValue > &value)
DataType::LIST constructor.
const CompleteDataType & getCompleteType() const
Get the CompleteDataType of this FieldValue.
const Function & getFunction() const
Return the value of a Function FieldValue Will throw an exception if this FieldValue is not of type D...
Class for representing moments in time and intervals at millisecond granularity.
Definition: Timestamp.hpp:39
Tuples are value types that can be copied and modified separately thus.
Definition: Tuple.hpp:47