XdkWrl: mfint32.h Source File

Home | Hierarchy | Members | Alphabetical | Related Pages

# mfint32.h

Go to the documentation of this file.

    00001 #ifndef XDKWRL_MFINT32_H
    00002 #define XDKWRL_MFINT32_H
    00003
    00004 #include <xdkwrl/fieldtypes/sfint32.h>
    00005 #include <deque>
    00006 #include <algorithm>
    00007 #include <iterator>
    00008
    00009 namespace wrl
    00010 {
    00011   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00012   // Interface of  MFInt32
    00013   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00014   /*! \ingroup fieldtypes
    00015    *
    00016    * A MFInt32 is a container of SFInt32. It is implemented using a STL's
    00017    * deque so you can benefit from its interface. Most common
    00018    * functionnalities you would use are:
    00019    \code
    00020    MFInt32 mf;
    00021    mf.push_back(SFInt32(1));  // push_back (1); would fail since
    00022    mf.push_front(SFInt32(2)); // constructor SFInt32(int) is explicit
    00023    mf[0] = 3; // Valid since SFInt32 has operator=(int)
    00024    \endcode
    00025    * but since it uses STL principles, you have all useful concepts such as
    00026    * iterator, algorithms, etc...
    00027    *
    00028    * Below is included the documentation for this field type from the ISO
    00029    * standard.
    00030    * \htmlinclude sfint32.html
    00031    */
    00032   class MFInt32 : public std::deque<SFInt32>
    00033   {
    00034   public:
    00035     inline MFInt32();
    00036     template <class T>
    00037     inline MFInt32(T first,T last);
    00038     static inline const char* typeName();
    00039     static inline FieldTypeId typeId();
    00040     friend std::ostream& operator<<(std::ostream& s,const MFInt32& f);
    00041   };
    00042   //************************************************************
    00043   // Implementation of MFInt32
    00044   //************************************************************
    00045   inline
    00046   MFInt32::MFInt32()
    00047   {
    00048   }
    00049   template <class T>
    00050   inline
    00051   MFInt32::MFInt32(T first,T last)
    00052     : std::deque<SFInt32>(first,last)
    00053   {
    00054   }
    00055   inline const char*
    00056   MFInt32::typeName()
    00057   {
    00058     return "MFInt32";
    00059   }
    00060   inline FieldTypeId
    00061   MFInt32::typeId()
    00062   {
    00063     return mfInt32;
    00064   }
    00065   inline std::ostream& operator<<(std::ostream& s,const MFInt32& f)
    00066   {
    00067     s<<'[';
    00068     std::copy(f.begin(),f.end(),std::ostream_iterator<SFInt32>(s," "));
    00069     return s<<']';
    00070   }
    00071 }
    00072
    00073 #endif // XDKWRL_MFINT32_H

Generated on 28 Jun 2006 with version 1.4.4. |