Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions

EventStoreValue< Type > Class Template Reference

A handy class object for storing simple values (like integers or strings) passed along with an Event. More...

#include "eventParameter.h"

Inheritance diagram for EventStoreValue< Type >:
EventStoreValueBase TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

 EventStoreValue (const Type &value)
virtual TypeHandle force_init_type ()
virtual TypeHandle get_type () const
const Type & get_value () const
 Retrieves the value stored in the parameter.
virtual void output (ostream &out) const
void set_value (const Type &value)
 Changes the value stored in the parameter.
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type (const string &type_name="UndefinedEventStoreValue")
static void register_with_read_factory ()
 Tells the BamReader how to create objects of type Lens.

Public Attributes

Type _value

Protected Member Functions

void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new Lens.

Static Protected Member Functions

static TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of type Lens is encountered in the Bam file.

Detailed Description

template<class Type>
class EventStoreValue< Type >

A handy class object for storing simple values (like integers or strings) passed along with an Event.

This is essentially just a wrapper around whatever data type you like, to make it a TypedWritableReferenceCount object which can be passed along inside an EventParameter.

Definition at line 159 of file eventParameter.h.


Member Function Documentation

template<class Type >
void EventStoreValue< Type >::fillin ( DatagramIterator scan,
BamReader manager 
) [protected, virtual]

This internal function is called by make_from_bam to read in all of the relevant data from the BamFile for the new Lens.

Reimplemented from TypedWritable.

Definition at line 470 of file eventParameter.I.

References TypedWritable::fillin().

Referenced by EventStoreValue< Type >::make_from_bam().

template<class Type >
const Type & EventStoreValue< Type >::get_value ( ) const [inline]
template<class Type >
TypedWritable * EventStoreValue< Type >::make_from_bam ( const FactoryParams params) [static, protected]

This function is called by the BamReader's factory when a new object of type Lens is encountered in the Bam file.

It should create the Lens and extract its information from the file.

Definition at line 450 of file eventParameter.I.

References EventStoreValue< Type >::fillin().

template<class Type >
void EventStoreValue< Type >::register_with_read_factory ( ) [static]

Tells the BamReader how to create objects of type Lens.

Definition at line 423 of file eventParameter.I.

References BamReader::get_factory(), and Factory< Type >::register_factory().

template<class Type >
void EventStoreValue< Type >::set_value ( const Type &  value) [inline]

Changes the value stored in the parameter.

It is dangerous to do this for a parameter already added to an event, since the parameters may be shared.

Definition at line 388 of file eventParameter.I.

template<class Type >
void EventStoreValue< Type >::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual]

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented from TypedWritable.

Definition at line 435 of file eventParameter.I.

References TypedWritable::write_datagram().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations