Panda3D
 All Classes Functions Variables Enumerations
writableParam.h
00001 // Filename: writableParam.h
00002 // Created by:  jason (13Jun00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef WRITABLEPARAM_H
00016 #define WRITABLEPARAM_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "factoryParam.h"
00021 #include "datagram.h"
00022 
00023 #include "pvector.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : WritableParam
00027 // Description : The specific derivation of FactoryParam that
00028 //               contains the information needed by a TypedWritable
00029 //               object.  Simply contains a Datagram for the object
00030 //               to construct itself from.
00031 ////////////////////////////////////////////////////////////////////
00032 class EXPCL_PANDA_PUTIL WritableParam : public FactoryParam {
00033 public:
00034   INLINE const Datagram &get_datagram();
00035 
00036 private:
00037   const Datagram &_packet;
00038 
00039 public:
00040   INLINE WritableParam(const Datagram &datagram);
00041   INLINE WritableParam(const WritableParam &other);
00042   INLINE ~WritableParam();
00043 
00044 private:
00045   // The assignment operator cannot be used for this class.
00046   INLINE void operator = (const WritableParam &other);
00047 
00048 public:
00049   virtual TypeHandle get_type() const {
00050     return get_class_type();
00051   }
00052   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00053   static TypeHandle get_class_type() {
00054     return _type_handle;
00055   }
00056   static void init_type() {
00057     FactoryParam::init_type();
00058     register_type(_type_handle, "WritableParam",
00059                   FactoryParam::get_class_type());
00060   }
00061 
00062 private:
00063   static TypeHandle _type_handle;
00064 };
00065 
00066 #include "writableParam.I"
00067 
00068 #endif
00069 
 All Classes Functions Variables Enumerations