Usecode_value Class Reference

#include <useval.h>

Collaboration diagram for Usecode_value:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Val_type {
  int_type = 0, string_type = 1, array_type = 2, end_of_array_type = 3,
  pointer_type = 4
}

Public Member Functions

 Usecode_value ()
 Usecode_value (int ival)
 Usecode_value (const char *s)
 Usecode_value (int size, Usecode_value *elem0)
 Usecode_value (Game_object *ptr)
 ~Usecode_value ()
Usecode_valueoperator= (const Usecode_value &v2)
Usecode_valueoperator= (const char *str)
 Usecode_value (const Usecode_value &v2)
Usecode_value operator+ (const Usecode_value &v2)
void push_back (int)
bool operator== (const Usecode_value &v2) const
bool operator!= (const Usecode_value &v2) const
Val_type get_type () const
int get_array_size () const
bool is_array () const
bool is_int () const
bool is_ptr () const
long get_int_value () const
Game_objectget_ptr_value () const
const char * get_str_value () const
long need_int_value () const
void put_elem (int i, Usecode_value &val)
Usecode_valueget_elem (int i) const
Usecode_valueoperator[] (int i)
Usecode_valueget_elem0 ()
bool is_false () const
bool is_true () const
bool is_undefined () const
int resize (int new_size)
int find_elem (const Usecode_value &val)
Usecode_valueconcat (Usecode_value &val2)
void append (int *vals, int cnt)
int add_values (int index, Usecode_value &val2)
void print (std::ostream &out, bool shortformat=false)
int save (unsigned char *buf, int len)
bool restore (unsigned char *&ptr, int len)

Static Private Member Functions

static int count_array (const Usecode_value &val)

Private Attributes

Val_type type
union {
   long   intval
   char *   str
   Usecode_value *   array
   Game_object *   ptr
value
bool undefined

Detailed Description

Definition at line 37 of file useval.h.


Member Enumeration Documentation

enum Usecode_value::Val_type

Enumerator:
int_type 
string_type 
array_type 
end_of_array_type 
pointer_type 

Definition at line 40 of file useval.h.


Constructor & Destructor Documentation

Usecode_value::Usecode_value (  )  [inline]

Definition at line 62 of file useval.h.

References value.

Referenced by operator+(), and push_back().

Usecode_value::Usecode_value ( int  ival  )  [inline]

Definition at line 64 of file useval.h.

References value.

Usecode_value::Usecode_value ( const char *  s  ) 

Definition at line 142 of file useval.cc.

References newstrdup().

Here is the call graph for this function:

Usecode_value::Usecode_value ( int  size,
Usecode_value elem0 
) [inline]

Definition at line 68 of file useval.h.

References end_of_array_type, and value.

Usecode_value::Usecode_value ( Game_object ptr  )  [inline]

Definition at line 76 of file useval.h.

References ptr, and value.

Usecode_value::~Usecode_value (  ) 

Definition at line 73 of file useval.cc.

References array_type, string_type, type, and value.

Usecode_value::Usecode_value ( const Usecode_value v2  )  [inline]

Definition at line 82 of file useval.h.


Member Function Documentation

int Usecode_value::count_array ( const Usecode_value val  )  [static, private]

Definition at line 58 of file useval.cc.

References array, type, and value.

Referenced by get_array_size(), and push_back().

Usecode_value & Usecode_value::operator= ( const Usecode_value v2  ) 

Definition at line 86 of file useval.cc.

References newstrdup().

Here is the call graph for this function:

Usecode_value & Usecode_value::operator= ( const char *  str  ) 

Definition at line 124 of file useval.cc.

References array, newstrdup(), and str.

Here is the call graph for this function:

Usecode_value Usecode_value::operator+ ( const Usecode_value v2  ) 

Definition at line 395 of file useval.cc.

References get_int_value(), get_str_value(), get_type(), int_type, is_undefined(), snprintf, string_type, and Usecode_value().

Here is the call graph for this function:

void Usecode_value::push_back ( int   ) 

Definition at line 181 of file useval.cc.

References count_array(), resize(), Usecode_value(), and value.

Here is the call graph for this function:

bool Usecode_value::operator== ( const Usecode_value v2  )  const

Definition at line 194 of file useval.cc.

References ptr, type, and value.

bool Usecode_value::operator!= ( const Usecode_value v2  )  const [inline]

Definition at line 90 of file useval.h.

Val_type Usecode_value::get_type (  )  const [inline]

Definition at line 92 of file useval.h.

References type.

Referenced by operator+(), and Usecode_internal::UI_printf().

int Usecode_value::get_array_size (  )  const [inline]

Definition at line 94 of file useval.h.

References array_type, count_array(), and type.

Referenced by Usecode_script::add(), Conversation::add_answer(), Usecode_internal::add_party_items(), add_values(), concat(), Usecode_internal::count_objects(), Usecode_internal::create_script(), Usecode_internal::find_nearby(), Usecode_internal::get_position(), need_int_value(), Usecode_internal::path_run_usecode(), Conversation::remove_answer(), Usecode_internal::remove_party_items(), Usecode_internal::run(), Usecode_script::start(), Usecode_internal::UI_find_object(), Usecode_internal::UI_get_npc_object(), Usecode_internal::UI_is_not_blocked(), Usecode_internal::UI_recall_virtue_stone(), Usecode_internal::UI_update_last_created(), and Usecode_script::Usecode_script().

Here is the call graph for this function:

bool Usecode_value::is_array (  )  const [inline]

Definition at line 96 of file useval.h.

References array_type, and type.

Referenced by add_values(), Usecode_internal::find_nearby(), Usecode_internal::get_item(), Conversation::remove_answer(), Usecode_internal::run(), Usecode_internal::UI_get_npc_object(), and Usecode_internal::UI_set_new_schedules().

bool Usecode_value::is_int (  )  const [inline]

Definition at line 98 of file useval.h.

References int_type, and type.

bool Usecode_value::is_ptr (  )  const [inline]

Definition at line 100 of file useval.h.

References pointer_type, and type.

Referenced by Usecode_internal::get_item().

long Usecode_value::get_int_value (  )  const [inline]

Definition at line 102 of file useval.h.

References int_type, pointer_type, type, and value.

Referenced by Usecode_internal::add_cont_items(), Usecode_internal::add_party_items(), Usecode_internal::count_objects(), Usecode_script::exec(), Usecode_internal::find_nearby(), Usecode_internal::find_nearest(), Usecode_internal::get_item(), Usecode_internal::get_objects(), Usecode_internal::get_position(), need_int_value(), operator+(), Usecode_internal::path_run_usecode(), Usecode_internal::remove_cont_items(), Usecode_internal::remove_party_items(), Usecode_internal::set_item_shape(), Usecode_internal::show_npc_face(), Usecode_script::start(), Usecode_internal::UI_is_not_blocked(), Usecode_internal::UI_modify_schedule(), Usecode_internal::UI_move_object(), Usecode_internal::UI_printf(), and Usecode_internal::UI_update_last_created().

Game_object* Usecode_value::get_ptr_value (  )  const [inline]

Definition at line 110 of file useval.h.

References pointer_type, type, and value.

Referenced by Usecode_internal::get_item().

const char* Usecode_value::get_str_value (  )  const [inline]

Definition at line 113 of file useval.h.

References string_type, type, and value.

Referenced by Conversation::add_answer(), Usecode_internal::item_say(), need_int_value(), operator+(), and Conversation::remove_answer().

long Usecode_value::need_int_value (  )  const [inline]

Definition at line 115 of file useval.h.

References array_type, get_array_size(), get_int_value(), get_str_value(), pointer_type, str, type, and value.

Referenced by Usecode_internal::popi(), and Usecode_internal::remove_party_items().

Here is the call graph for this function:

void Usecode_value::put_elem ( int  i,
Usecode_value val 
) [inline]

Definition at line 127 of file useval.h.

References value.

Referenced by Usecode_internal::get_party(), Usecode_internal::run(), Usecode_internal::UI_click_on_item(), Usecode_internal::UI_get_dead_party(), Usecode_internal::UI_get_npc_name(), Usecode_internal::UI_get_npc_object(), and Usecode_internal::UI_get_object_position().

Usecode_value& Usecode_value::get_elem ( int  i  )  const [inline]

Definition at line 130 of file useval.h.

References array_type, type, and value.

Referenced by Conversation::add_answer(), Usecode_internal::add_party_items(), add_values(), concat(), Usecode_internal::count_objects(), Usecode_internal::create_script(), Usecode_script::exec(), Usecode_internal::find_nearby(), Usecode_internal::get_position(), Usecode_internal::path_run_usecode(), Usecode_script::print(), Conversation::remove_answer(), Usecode_internal::remove_party_items(), Usecode_script::restore(), Usecode_internal::run(), Usecode_script::save(), Usecode_script::start(), Usecode_internal::UI_find_object(), Usecode_internal::UI_get_npc_object(), Usecode_internal::UI_is_not_blocked(), Usecode_internal::UI_move_object(), Usecode_internal::UI_recall_virtue_stone(), and Usecode_internal::UI_update_last_created().

Usecode_value& Usecode_value::operator[] ( int  i  )  [inline]

Definition at line 136 of file useval.h.

References array_type, type, and value.

Usecode_value& Usecode_value::get_elem0 (  )  [inline]

Definition at line 142 of file useval.h.

References array_type, type, and value.

Referenced by Usecode_internal::get_item(), Usecode_internal::path_run_usecode(), and Usecode_internal::run().

bool Usecode_value::is_false (  )  const [inline]

Definition at line 144 of file useval.h.

References array_type, end_of_array_type, int_type, pointer_type, type, and value.

Referenced by is_true(), Usecode_internal::run(), and Usecode_internal::uc_trace_disasm().

bool Usecode_value::is_true (  )  const [inline]

Definition at line 158 of file useval.h.

References is_false().

Referenced by Usecode_internal::run().

Here is the call graph for this function:

bool Usecode_value::is_undefined (  )  const [inline]

Definition at line 161 of file useval.h.

References undefined.

Referenced by operator+().

int Usecode_value::resize ( int  new_size  ) 

Definition at line 157 of file useval.cc.

References array, size, and type.

Referenced by Usecode_script::add(), push_back(), and Usecode_internal::run().

int Usecode_value::find_elem ( const Usecode_value val  ) 

Definition at line 255 of file useval.cc.

Referenced by Usecode_internal::run().

Usecode_value & Usecode_value::concat ( Usecode_value val2  ) 

Definition at line 275 of file useval.cc.

References get_array_size(), get_elem(), size, and type.

Referenced by Usecode_internal::add_party_items(), and Usecode_internal::run().

Here is the call graph for this function:

void Usecode_value::append ( int *  vals,
int  cnt 
)

Definition at line 308 of file useval.cc.

Referenced by Usecode_script::add().

int Usecode_value::add_values ( int  index,
Usecode_value val2 
)

Definition at line 328 of file useval.cc.

References get_array_size(), get_elem(), is_array(), and size.

Referenced by Usecode_internal::run().

Here is the call graph for this function:

void Usecode_value::print ( std::ostream &  out,
bool  shortformat = false 
)

Referenced by Usecode_internal::call_function(), operator<<(), Usecode_script::print(), Usecode_internal::return_from_function(), Usecode_internal::uc_trace_disasm(), Usecode_internal::UI_printf(), Usecode_internal::UI_update_last_created(), and Usecode_TraceReturn().

int Usecode_value::save ( unsigned char *  buf,
int  len 
)

Definition at line 449 of file useval.cc.

References len, Write2(), and Write4().

Referenced by Write_useval().

Here is the call graph for this function:

bool Usecode_value::restore ( unsigned char *&  ptr,
int  len 
)

Definition at line 511 of file useval.cc.

References len, Read2(), and Read4().

Referenced by Stack_frame_in().

Here is the call graph for this function:


Member Data Documentation

Val_type Usecode_value::type [private]

Definition at line 49 of file useval.h.

Referenced by concat(), count_array(), get_array_size(), get_elem(), get_elem0(), get_int_value(), get_ptr_value(), get_str_value(), get_type(), is_array(), is_false(), is_int(), is_ptr(), need_int_value(), operator==(), operator[](), resize(), and ~Usecode_value().

long Usecode_value::intval [private]

Definition at line 52 of file useval.h.

char* Usecode_value::str [private]

Definition at line 53 of file useval.h.

Referenced by need_int_value(), and operator=().

Usecode_value* Usecode_value::array [private]

Definition at line 54 of file useval.h.

Referenced by count_array(), operator=(), and resize().

Game_object* Usecode_value::ptr [private]

Definition at line 55 of file useval.h.

Referenced by operator==(), and Usecode_value().

union { ... } Usecode_value::value [private]

Referenced by count_array(), get_elem(), get_elem0(), get_int_value(), get_ptr_value(), get_str_value(), is_false(), need_int_value(), operator==(), operator[](), push_back(), put_elem(), Usecode_value(), and ~Usecode_value().

bool Usecode_value::undefined [private]

Definition at line 58 of file useval.h.

Referenced by is_undefined().


The documentation for this class was generated from the following files:
Generated on Mon Jul 9 15:05:39 2007 for ExultEngine by  doxygen 1.5.1