Panda3D
paramNodePath.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 paramNodePath.h
10  * @author rdb
11  * @date 2015-02-25
12  */
13 
14 #ifndef PARAMNODEPATH_H
15 #define PARAMNODEPATH_H
16 
17 #include "pandabase.h"
18 #include "paramValue.h"
19 #include "nodePath.h"
20 
21 /**
22  * A class object for storing a NodePath as a parameter.
23  */
24 class EXPCL_PANDA_PGRAPH ParamNodePath : public ParamValueBase {
25 protected:
26  INLINE ParamNodePath() {};
27 
28 PUBLISHED:
29  INLINE ParamNodePath(const NodePath &node_path);
30  INLINE ParamNodePath(NodePath &&node_path) noexcept;
31 
32  INLINE virtual TypeHandle get_value_type() const;
33  INLINE const NodePath &get_value() const;
34 
35  virtual void output(std::ostream &out) const;
36 
37 private:
38  NodePath _node_path;
39 
40 public:
41  static void register_with_read_factory();
42  virtual void write_datagram(BamWriter *manager, Datagram &dg);
44  BamReader *manager);
45 
46 protected:
47  static TypedWritable *make_from_bam(const FactoryParams &params);
48  void fillin(DatagramIterator &scan, BamReader *manager);
49 
50 public:
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55  static TypeHandle get_class_type() {
56  return _type_handle;
57  }
58  static void init_type() {
59  ParamValueBase::init_type();
60  register_type(_type_handle, "ParamNodePath",
61  ParamValueBase::get_class_type());
62  }
63 
64 private:
65  static TypeHandle _type_handle;
66 };
67 
68 #include "paramNodePath.I"
69 
70 #endif
A class object for storing a NodePath as a parameter.
Definition: paramNodePath.h:24
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
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.
A non-template base class of ParamValue (below), which serves mainly to define the placeholder for th...
Definition: paramValue.h:31
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().
virtual TypeHandle get_value_type() const
Returns the type of the underlying value.
Definition: paramValue.I:28
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
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:161