XdkWrl: sfnode.h Source File

Home | Hierarchy | Members | Alphabetical | Related Pages

# sfnode.h

Go to the documentation of this file.

    00001 #ifndef XDKWRL_SFNODE_H
    00002 #define XDKWRL_SFNODE_H
    00003
    00004 #include <xdkwrl/fieldtypes.h>
    00005 #include <iostream>
    00006
    00007 namespace wrl
    00008 {
    00009   class Node;
    00010   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00011   // Interface of SFNode
    00012   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00013   /*! \ingroup fieldtypes
    00014    *
    00015    * Represents a pointer to a Node. Below is included the documentation for
    00016    * this field type from the ISO standard.
    00017    * \htmlinclude sfnode.html
    00018    */
    00019   class SFNode
    00020   {
    00021   public:
    00022     inline SFNode();
    00023     inline SFNode(Node* n);
    00024     inline SFNode& operator=(Node* n);
    00025     inline SFNode& operator=(const SFNode n);
    00026     inline operator Node*() const;
    00027     inline Node* node() const;
    00028     inline Node* operator->() const;
    00029     static inline const char* typeName();
    00030     static inline FieldTypeId typeId();
    00031     friend std::ostream& operator<<(std::ostream& s,const SFNode& f);
    00032   protected:
    00033   private:
    00034     Node* value_;
    00035   };
    00036   //************************************************************
    00037   // Implementation of SFNode
    00038   //************************************************************
    00039   inline
    00040   SFNode::SFNode()
    00041     : value_(NULL)
    00042   {
    00043   }
    00044   inline
    00045   SFNode::SFNode(Node* n)
    00046     : value_(n)
    00047   {
    00048   }
    00049   inline SFNode&
    00050   SFNode::operator=(Node* n)
    00051   {
    00052     value_ = n;
    00053     return *this;
    00054   }
    00055   inline SFNode&
    00056   SFNode::operator=(const SFNode n)
    00057   {
    00058     value_ = n.value_;
    00059     return *this;
    00060   }
    00061   inline
    00062   SFNode::operator Node*() const
    00063   {
    00064     return value_;
    00065   }
    00066   inline Node*
    00067   SFNode::node() const
    00068   {
    00069     return value_;
    00070   }
    00071   inline Node*
    00072   SFNode::operator->() const
    00073   {
    00074     return value_;
    00075   }
    00076   inline const char*
    00077   SFNode::typeName()
    00078   {
    00079     return "SFNode";
    00080   }
    00081   inline FieldTypeId
    00082   SFNode::typeId()
    00083   {
    00084     return sfNode;
    00085   }
    00086   inline std::ostream& operator<<(std::ostream& s,const SFNode& f)
    00087   {
    00088     return s<<f.value_;
    00089   }
    00090 };
    00091
    00092
    00093 #endif // XDKWRL_SFNODE_H

Generated on 28 Jun 2006 with version 1.4.4. |