2002-06-21 11:16:28 +00:00
|
|
|
#ifndef JEZUK_DOM_ENTITYREFERENCE_H
|
|
|
|
#define JEZUK_DOM_ENTITYREFERENCE_H
|
|
|
|
|
|
|
|
////////////////////////////
|
|
|
|
// C++ DOM definition
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
////////////////////////////
|
|
|
|
|
2007-09-04 22:55:47 +00:00
|
|
|
#include <DOM/Node.hpp>
|
2002-06-21 11:16:28 +00:00
|
|
|
|
2007-09-05 11:47:13 +00:00
|
|
|
namespace Arabica
|
|
|
|
{
|
2002-06-21 11:16:28 +00:00
|
|
|
namespace DOM
|
|
|
|
{
|
2007-09-07 22:03:27 +00:00
|
|
|
template<class stringT, class string_adaptorT> class EntityReference_impl;
|
2002-06-21 11:16:28 +00:00
|
|
|
|
2007-09-08 22:31:24 +00:00
|
|
|
template<class stringT, class string_adaptorT = Arabica::default_string_adaptor<stringT> >
|
2007-09-07 22:03:27 +00:00
|
|
|
class EntityReference : public Node<stringT, string_adaptorT>
|
2002-06-21 11:16:28 +00:00
|
|
|
{
|
2007-09-07 22:03:27 +00:00
|
|
|
typedef EntityReference_impl<stringT, string_adaptorT> EntityReference_implT;
|
|
|
|
|
2002-06-21 11:16:28 +00:00
|
|
|
public:
|
2007-09-07 22:03:27 +00:00
|
|
|
typedef Node<stringT, string_adaptorT> NodeT;
|
|
|
|
|
|
|
|
EntityReference() : NodeT() { }
|
|
|
|
explicit EntityReference(EntityReference_implT* impl) : NodeT(impl) { }
|
|
|
|
EntityReference(const EntityReference& rhs) : NodeT(rhs) { }
|
|
|
|
explicit EntityReference(const NodeT& rhs) : NodeT(rhs)
|
2002-06-21 11:16:28 +00:00
|
|
|
{
|
2010-12-09 11:35:54 +00:00
|
|
|
if(NodeT::impl_ == 0) // null nodes can always be cast
|
|
|
|
return;
|
|
|
|
if(rhs.getNodeType() != Node_base::ENTITY_REFERENCE_NODE)
|
2010-12-10 09:24:34 +00:00
|
|
|
throw DOMBadCast("EntityReference");
|
2002-06-21 11:16:28 +00:00
|
|
|
} // EntityReference
|
|
|
|
}; // class EntityReference
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
2007-09-07 22:03:27 +00:00
|
|
|
template<class stringT, class string_adaptorT>
|
|
|
|
class EntityReference_impl : virtual public Node_impl<stringT, string_adaptorT>
|
2002-06-21 11:16:28 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~EntityReference_impl () { }
|
|
|
|
}; // EntityReference_impl
|
|
|
|
|
|
|
|
} // namespace DOM
|
2007-09-05 11:47:13 +00:00
|
|
|
} // namespace Arabica
|
2002-06-21 11:16:28 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|