Panda3D
 All Classes Functions Variables Enumerations
paramNodePath.h
1 // Filename: paramNodePath.h
2 // Created by: rdb (25Feb15)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PARAMNODEPATH_H
16 #define PARAMNODEPATH_H
17 
18 #include "pandabase.h"
19 #include "paramValue.h"
20 #include "nodePath.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : ParamNodePath
24 // Description : A class object for storing a NodePath as a parameter.
25 ////////////////////////////////////////////////////////////////////
26 class EXPCL_PANDA_GOBJ ParamNodePath : public ParamValueBase {
27 protected:
28  INLINE ParamNodePath() {};
29 
30 PUBLISHED:
31  INLINE ParamNodePath(const NodePath &node_path);
32 
33 #ifdef USE_MOVE_SEMANTICS
34  INLINE ParamNodePath(NodePath &&node_path) NOEXCEPT;
35 #endif
36 
37  INLINE virtual TypeHandle get_value_type() const;
38  INLINE const NodePath &get_value() const;
39 
40  virtual void output(ostream &out) const;
41 
42 private:
43  NodePath _node_path;
44 
45 public:
46  static void register_with_read_factory();
47  virtual void write_datagram(BamWriter *manager, Datagram &dg);
49  BamReader *manager);
50 
51 protected:
52  static TypedWritable *make_from_bam(const FactoryParams &params);
53  void fillin(DatagramIterator &scan, BamReader *manager);
54 
55 public:
56  virtual TypeHandle get_type() const {
57  return get_class_type();
58  }
59  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
60  static TypeHandle get_class_type() {
61  return _type_handle;
62  }
63  static void init_type() {
64  ParamValueBase::init_type();
65  register_type(_type_handle, "ParamNodePath",
66  ParamValueBase::get_class_type());
67  }
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 #include "paramNodePath.I"
74 
75 #endif
A class object for storing a NodePath as a parameter.
Definition: paramNodePath.h:26
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
This is our own Panda specialization on the default STL list.
Definition: plist.h:38
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.
A non-template base class of ParamValue (below), which serves mainly to define the placeholder for th...
Definition: paramValue.h:34
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:40
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:85
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165
virtual TypeHandle get_value_type() const
Returns the type of the underlying value.
Definition: paramValue.I:34