Panda3D
dataNodeTransmit.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file dataNodeTransmit.h
10  * @author drose
11  * @date 2002-03-11
12  */
13 
14 #ifndef DATANODETRANSMIT_H
15 #define DATANODETRANSMIT_H
16 
17 #include "pandabase.h"
18 #include "eventParameter.h"
19 #include "typedWritable.h"
20 #include "deletedChain.h"
21 
22 class Datagram;
23 class DatagramIterator;
24 class BamReader;
25 class BamWriter;
26 
27 /**
28  * Encapsulates the data generated from (or sent into) any particular
29  * DataNode. This is basically just an array of EventParameters, one for each
30  * registered input or output wire.
31  */
32 class EXPCL_PANDA_DGRAPH DataNodeTransmit : public TypedWritable {
33 public:
34  INLINE DataNodeTransmit();
35  INLINE DataNodeTransmit(const DataNodeTransmit &copy);
36  INLINE void operator = (const DataNodeTransmit &copy);
37  virtual ~DataNodeTransmit();
38  ALLOC_DELETED_CHAIN(DataNodeTransmit);
39 
40  INLINE void reserve(int num_wires);
41 
42  INLINE const EventParameter &get_data(int index) const;
43  INLINE bool has_data(int index) const;
44  INLINE void set_data(int index, const EventParameter &data);
45 
46 private:
47  void slot_data(int index);
48 
50  Data _data;
51 
52 public:
53  static void register_with_read_factory();
54  virtual void write_datagram(BamWriter *manager, Datagram &dg);
56  BamReader *manager);
57 
58 protected:
59  static TypedWritable *make_from_bam(const FactoryParams &params);
60  void fillin(DatagramIterator &scan, BamReader *manager);
61 
62 public:
63  static TypeHandle get_class_type() {
64  return _type_handle;
65  }
66  static void init_type() {
67  TypedWritable::init_type();
68  register_type(_type_handle, "DataNodeTransmit",
69  TypedWritable::get_class_type());
70  }
71  virtual TypeHandle get_type() const {
72  return get_class_type();
73  }
74  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
75 
76 private:
77  static TypeHandle _type_handle;
78 };
79 
80 #include "dataNodeTransmit.I"
81 
82 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An optional parameter associated with an event.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
This is our own Panda specialization on the default STL list.
Definition: plist.h:35
virtual void fillin(DatagramIterator &scan, BamReader *manager)
This internal function is intended to be called by each class's make_from_bam() method to read in all...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Encapsulates the data generated from (or sent into) any particular DataNode.