All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
uscript::TData Struct Reference

#include <tclass.h>

Public Member Functions

int Size () const
 
int Length (uint8_t *loc) const
 

Public Attributes

TClassInfoinfo
 
TFieldType type
 
int len
 

Detailed Description

Definition at line 23 of file tclass.h.

Member Function Documentation

int uscript::TData::Length ( uint8_t *  loc) const

Definition at line 167 of file tclass.cc.

167  {
168  if (info && info->is_vec) {
169  // FIXME: this is probably implementation defined -- needs to be fixed
170  uint8_t **vec = (uint8_t**)loc;
171  uint8_t *start = vec[0];
172  uint8_t *end = vec[1];
173  return (end - start) / Size();
174  }
175  else {
176  return len;
177  }
178 
179 }
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
int Size() const
Definition: tclass.cc:153
TClassInfo * info
Definition: tclass.h:24
int uscript::TData::Size ( ) const

Definition at line 153 of file tclass.cc.

153  {
154  switch (type) {
155  case uscript::FIELD_BOOL: return sizeof(bool);
156  case uscript::FIELD_INT: return sizeof(int);
157  case uscript::FIELD_UNSIGNED: return sizeof(unsigned);
158  case uscript::FIELD_FLOAT: return sizeof(float);
159  case uscript::FIELD_DOUBLE: return sizeof(double);
160  case uscript::FIELD_ENUM: return 4;
161  case uscript::FIELD_TINSTANCE: return info->size;
162  }
163  // unreachable
164  return -1;
165 }
static constexpr bool
TClassInfo * info
Definition: tclass.h:24

Member Data Documentation

TClassInfo* uscript::TData::info

Definition at line 24 of file tclass.h.

int uscript::TData::len

Definition at line 26 of file tclass.h.

TFieldType uscript::TData::type

Definition at line 25 of file tclass.h.


The documentation for this struct was generated from the following files: