Go to the documentation of this file.
55 setInt(asInt() + var.
asInt());
58 setGauge(asGauge() + var.
asGauge());
61 setCounter(asCounter() + var.
asCounter());
83 setInt(asInt() / num);
86 setGauge(asGauge() / num);
89 setCounter(asCounter() / num);
92 setCounter64(asCounter64() / num);
95 setTimeTicks(asTimeTicks() / num);
110 return asInt() < var.
asInt();
112 return asGauge() < var.
asGauge();
132 return asInt() > var.
asInt();
134 return asGauge() > var.
asGauge();
175 name_length = aName.
size();
176 name =
static_cast<oid*
>(
xmalloc(name_length *
sizeof(
oid)));
177 std::copy(aName.
start, aName.
end, name);
185 val.string =
nullptr;
200 Must(val.integer !=
nullptr && val_len ==
sizeof(
int));
208 Must(val.integer !=
nullptr && val_len == 4);
209 return *
reinterpret_cast<unsigned int*
>(val.integer);
216 Must(val.integer !=
nullptr && val_len == 4);
217 return *
reinterpret_cast<int*
>(val.integer);
224 Must(val.integer !=
nullptr && val_len == 8);
225 return *
reinterpret_cast<long long int*
>(val.integer);
232 Must(val.integer !=
nullptr && val_len ==
sizeof(
unsigned int));
233 return *
reinterpret_cast<unsigned int*
>(val.integer);
240 Must(val_len %
sizeof(
oid) == 0);
241 int length = val_len /
sizeof(
oid);
242 Must(val.objid !=
nullptr && length > 0);
250 Must(val.string !=
nullptr && val_len > 0);
306 if (value !=
nullptr) {
307 Must(length > 0 && aType > 0);
308 val.string =
static_cast<u_char*
>(
xmalloc(length));
309 memcpy(val.string, value, length);
327 if (name_length > 0) {
328 Must(name !=
nullptr);
334 Must(val.string !=
nullptr);
344 name_length = msg.
getInt();
345 Must(name_length >= 0);
346 if (name_length > 0) {
347 name =
static_cast<oid*
>(
xmalloc(name_length *
sizeof(
oid)));
354 val.string =
static_cast<u_char*
>(
xmalloc(val_len));
void init()
initialize members
void setValue(const void *value, int length, int aType)
set new variable value
union variable_list::@19 val
void putFixed(const void *raw, size_t size)
always store size bytes
void clearValue()
clear .val member
void pack(Ipc::TypedMsgHdr &msg) const
prepare for sendmsg()
int asCounter() const
returns variable value as Counter32
void setString(const Range< const u_char * > &string)
assign string to variable
void clear()
clear all internal members
#define TexcHere(msg)
legacy convenience macro; it is not difficult to type Here() now
void unpack(const Ipc::TypedMsgHdr &msg)
restore struct from the message
unsigned int asTimeTicks() const
returns variable value as time ticks
void putPod(const Pod &pod)
store POD
void putInt(int n)
store an integer
void setGauge(unsigned int value)
assign unsigned int value to variable
unsigned int asGauge() const
returns variable value as unsigned int
Var & operator+=(const Var &var)
void setTimeTicks(unsigned int ticks)
assign unsigned int (time) value to variable
Var & operator/=(int num)
int getInt() const
load an integer
void setInt(int value)
assign int value to variable
void setObject(const Range< const oid * > &object)
assign object oid to variable
void setName(const Range< const oid * > &aName)
set new variable name
bool operator>(const Var &var) const
long long int asCounter64() const
returns variable value as Counter64
void clearName()
clear variable name
int asInt() const
returns variable value as integer
void assign(const Var &var)
perform full assignment
Range< const oid * > getName() const
returns variable name
struct msghdr with a known type, fixed-size I/O and control buffers
Var & operator=(const Var &var)
static void copyValue(void *dst, const DB_ENTRY *src, size_t sz)
void getPod(Pod &pod) const
load POD
#define debugs(SECTION, LEVEL, CONTENT)
Range< const oid * > asObject() const
returns variable value as object oid
bool operator<(const Var &var) const
void copyValue(const Var &var)
copy variable from another one
Range< const u_char * > asString() const
returns variable value as chars string
void getFixed(void *raw, size_t size) const
always load size bytes
void setCounter64(long long int counter)
assign Counter64 value to variable
void setCounter(int value)
assign Counter32 value to variable