|
From: <br...@us...> - 2009-03-30 04:23:46
|
Revision: 3874
http://openvrml.svn.sourceforge.net/openvrml/?rev=3874&view=rev
Author: braden
Date: 2009-03-30 04:23:36 +0000 (Mon, 30 Mar 2009)
Log Message:
-----------
Expose the types openvrml::null_node_metatype and openvrml::null_node_type.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/libopenvrml/openvrml/browser.cpp
trunk/src/libopenvrml/openvrml/browser.h
trunk/src/libopenvrml/openvrml/node.cpp
trunk/src/libopenvrml/openvrml/node.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-03-30 02:30:12 UTC (rev 3873)
+++ trunk/ChangeLog 2009-03-30 04:23:36 UTC (rev 3874)
@@ -1,3 +1,18 @@
+2009-03-30 Braden McDaniel <br...@en...>
+
+ Expose the types openvrml::null_node_metatype and
+ openvrml::null_node_type.
+
+ * src/libopenvrml/openvrml/browser.cpp: Removed
+ openvrml::null_node_metatype and openvrml::null_node_type.
+ * src/libopenvrml/openvrml/browser.h: No longer need to declare
+ openvrml::null_node_metatype and openvrml::null_node_type.
+ * src/libopenvrml/openvrml/node.cpp: Moved definitions of member
+ functions of openvrml::null_node_metatype and
+ openvrml::null_node_type here.
+ * src/libopenvrml/openvrml/node.h: Moved definitions of
+ openvrml::null_node_metatype and openvrml::null_node_type here.
+
2009-03-29 Braden McDaniel <br...@en...>
Use the nonvirtual interface pattern consistently with the
Modified: trunk/src/libopenvrml/openvrml/browser.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/browser.cpp 2009-03-30 02:30:12 UTC (rev 3873)
+++ trunk/src/libopenvrml/openvrml/browser.cpp 2009-03-30 04:23:36 UTC (rev 3874)
@@ -55,38 +55,6 @@
* @brief Classes that manage the scene.
*/
-namespace openvrml {
-
- class OPENVRML_LOCAL null_node_metatype : public node_metatype {
- public:
- explicit null_node_metatype(openvrml::browser & browser)
- OPENVRML_NOTHROW;
- virtual ~null_node_metatype() OPENVRML_NOTHROW;
-
- private:
- virtual const boost::shared_ptr<node_type>
- do_create_type(const std::string & id,
- const node_interface_set & interfaces) const
- OPENVRML_NOTHROW;
- };
-
-
- class OPENVRML_LOCAL null_node_type : public node_type {
- public:
- explicit null_node_type(null_node_metatype & nodeClass)
- OPENVRML_NOTHROW;
- virtual ~null_node_type() OPENVRML_NOTHROW;
-
- private:
- virtual const node_interface_set & do_interfaces() const
- OPENVRML_NOTHROW;
- virtual const boost::intrusive_ptr<node>
- do_create_node(const boost::shared_ptr<openvrml::scope> & scope,
- const initial_value_map & initial_values) const
- OPENVRML_NOTHROW;
- };
-} // namespace openvrml
-
namespace {
class OPENVRML_LOCAL default_navigation_info :
@@ -2567,50 +2535,3 @@
boost::mutex::scoped_lock(this->err_mutex_);
*this->err_ << str << std::endl;
}
-
-
-openvrml::null_node_metatype::null_node_metatype(openvrml::browser & browser)
- OPENVRML_NOTHROW:
- node_metatype("urn:X-openvrml:node:null", browser)
-{}
-
-openvrml::null_node_metatype::~null_node_metatype() OPENVRML_NOTHROW
-{}
-
-const boost::shared_ptr<openvrml::node_type>
-openvrml::null_node_metatype::
-do_create_type(const std::string &, const node_interface_set &) const
- OPENVRML_NOTHROW
-{
- assert(false);
- static const boost::shared_ptr<node_type> nodeType;
- return nodeType;
-}
-
-
-openvrml::null_node_type::null_node_type(null_node_metatype & nodeClass)
- OPENVRML_NOTHROW:
- node_type(nodeClass, std::string())
-{}
-
-openvrml::null_node_type::~null_node_type() OPENVRML_NOTHROW
-{}
-
-const openvrml::node_interface_set &
-openvrml::null_node_type::do_interfaces() const OPENVRML_NOTHROW
-{
- assert(false);
- static const node_interface_set interfaces;
- return interfaces;
-}
-
-const boost::intrusive_ptr<openvrml::node>
-openvrml::null_node_type::
-do_create_node(const boost::shared_ptr<openvrml::scope> &,
- const initial_value_map &) const
- OPENVRML_NOTHROW
-{
- assert(false);
- static const boost::intrusive_ptr<node> node;
- return node;
-}
Modified: trunk/src/libopenvrml/openvrml/browser.h
===================================================================
--- trunk/src/libopenvrml/openvrml/browser.h 2009-03-30 02:30:12 UTC (rev 3873)
+++ trunk/src/libopenvrml/openvrml/browser.h 2009-03-30 04:23:36 UTC (rev 3874)
@@ -176,8 +176,6 @@
class viewer;
class scene;
- class null_node_metatype;
- class null_node_type;
namespace local {
struct vrml97_parse_actions;
Modified: trunk/src/libopenvrml/openvrml/node.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/node.cpp 2009-03-30 02:30:12 UTC (rev 3873)
+++ trunk/src/libopenvrml/openvrml/node.cpp 2009-03-30 04:23:36 UTC (rev 3874)
@@ -927,6 +927,51 @@
/**
+ * @class openvrml::null_node_metatype openvrml/node.h
+ *
+ * @brief A placeholder @c node_metatype.
+ *
+ * The @c null_node_metatype is provided for convenience for the uncommon (but
+ * not inconceivable) situation where one needs something that acts like a
+ * @c node, yet isn't a full-fleged node with proper @c node_metatype and
+ * @c node_type implementations.
+ *
+ * @sa openvrml::null_node_type
+ */
+
+/**
+ * @brief Construct.
+ *
+ * @param browser a @c browser.
+ */
+openvrml::null_node_metatype::null_node_metatype(openvrml::browser & browser)
+ OPENVRML_NOTHROW:
+ node_metatype("urn:X-openvrml:node:null", browser)
+{}
+
+/**
+ * @brief Destroy.
+ */
+openvrml::null_node_metatype::~null_node_metatype() OPENVRML_NOTHROW
+{}
+
+/**
+ * @brief Do not call.
+ *
+ * @warning Correct code will not call this function.
+ */
+const boost::shared_ptr<openvrml::node_type>
+openvrml::null_node_metatype::
+do_create_type(const std::string &, const node_interface_set &) const
+ OPENVRML_NOTHROW
+{
+ assert(false);
+ static const boost::shared_ptr<node_type> type;
+ return type;
+}
+
+
+/**
* @typedef openvrml::initial_value_map
*
* @brief A map of the initial values with which a @c node is instantiated.
@@ -1127,6 +1172,63 @@
/**
+ * @class openvrml::null_node_type openvrml/node.h
+ *
+ * @brief A placeholder @c node_type.
+ *
+ * The @c null_node_type is provided for convenience for the uncommon (but not
+ * inconceivable) situation where one needs something that acts like a
+ * @c node, yet isn't a full-fleged node with proper @c node_metatype and
+ * @c node_type implementations.
+ *
+ * @sa openvrml::null_node_metatype
+ */
+
+/**
+ * @brief Construct.
+ */
+openvrml::null_node_type::null_node_type(null_node_metatype & metatype)
+ OPENVRML_NOTHROW:
+ node_type(metatype, std::string())
+{}
+
+/**
+ * @brief Destroy.
+ */
+openvrml::null_node_type::~null_node_type() OPENVRML_NOTHROW
+{}
+
+/**
+ * @brief Do not call.
+ *
+ * @warning Correct code will not call this function.
+ */
+const openvrml::node_interface_set &
+openvrml::null_node_type::do_interfaces() const OPENVRML_NOTHROW
+{
+ assert(false);
+ static const node_interface_set interfaces;
+ return interfaces;
+}
+
+/**
+ * @brief Do not call.
+ *
+ * @warning Correct code will not call this function.
+ */
+const boost::intrusive_ptr<openvrml::node>
+openvrml::null_node_type::
+do_create_node(const boost::shared_ptr<openvrml::scope> &,
+ const initial_value_map &) const
+ OPENVRML_NOTHROW
+{
+ assert(false);
+ static const boost::intrusive_ptr<node> node;
+ return node;
+}
+
+
+/**
* @class openvrml::field_value_type_mismatch openvrml/node.h
*
* @brief Thrown when field value types do not match, generally in a @c ROUTE
Modified: trunk/src/libopenvrml/openvrml/node.h
===================================================================
--- trunk/src/libopenvrml/openvrml/node.h 2009-03-30 02:30:12 UTC (rev 3873)
+++ trunk/src/libopenvrml/openvrml/node.h 2009-03-30 04:23:36 UTC (rev 3874)
@@ -274,6 +274,20 @@
};
+ class OPENVRML_API null_node_metatype : public node_metatype {
+ public:
+ explicit null_node_metatype(openvrml::browser & browser)
+ OPENVRML_NOTHROW;
+ virtual ~null_node_metatype() OPENVRML_NOTHROW;
+
+ private:
+ virtual const boost::shared_ptr<node_type>
+ do_create_type(const std::string & id,
+ const node_interface_set & interfaces) const
+ OPENVRML_NOTHROW;
+ };
+
+
typedef std::map<std::string, boost::shared_ptr<field_value> >
initial_value_map;
@@ -316,6 +330,22 @@
OPENVRML_NOTHROW;
+ class OPENVRML_API null_node_type : public node_type {
+ public:
+ explicit null_node_type(null_node_metatype & nodeClass)
+ OPENVRML_NOTHROW;
+ virtual ~null_node_type() OPENVRML_NOTHROW;
+
+ private:
+ virtual const node_interface_set & do_interfaces() const
+ OPENVRML_NOTHROW;
+ virtual const boost::intrusive_ptr<node>
+ do_create_node(const boost::shared_ptr<openvrml::scope> & scope,
+ const initial_value_map & initial_values) const
+ OPENVRML_NOTHROW;
+ };
+
+
class OPENVRML_API field_value_type_mismatch : public std::logic_error {
public:
field_value_type_mismatch();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|