Reference Class Reference

#include <Reference.hpp>

List of all members.

Public Types

typedef std::vector< bool > Representation

Public Member Functions

const bool & insideDomain () const
bool & insideDomain ()
void resize (const size_t i)
size_t size () const
void set (const Representation &r)
bool isSet () const
bool isSet (const Reference::Representation &r) const
bool operator== (const Reference &R) const
bool operator!= (const Reference &R) const
const Referenceoperator= (const size_t &i)
const Referenceoperator= (const Reference &R)
void set (const size_t &i, const bool &b)
bool get (const size_t &i) const
 Reference ()
 Reference (const Reference &R)
 Reference (const size_t size)
 ~Reference ()

Private Attributes

Reference::Representation __reference
bool __insideDomain

Friends

std::ostream & operator<< (std::ostream &os, const Reference &R)


Detailed Description

Definition at line 34 of file Reference.hpp.


Member Typedef Documentation

typedef std::vector<bool> Reference::Representation

Definition at line 37 of file Reference.hpp.


Constructor & Destructor Documentation

Reference::Reference (  )  [inline]

Definition at line 147 of file Reference.hpp.

00148   {
00149     ;
00150   }

Reference::Reference ( const Reference R  )  [inline]

Definition at line 152 of file Reference.hpp.

00153     : __reference(R.__reference)
00154   {
00155     ;
00156   }

Reference::Reference ( const size_t  size  )  [inline]

Definition at line 158 of file Reference.hpp.

References __reference.

00159   {
00160     __reference.resize(size);
00161   }

Reference::~Reference (  )  [inline]

Definition at line 163 of file Reference.hpp.

00164   {
00165     ;
00166   }


Member Function Documentation

const bool& Reference::insideDomain (  )  const [inline]

Definition at line 46 of file Reference.hpp.

References __insideDomain.

00047   {
00048     return __insideDomain;
00049   }

bool& Reference::insideDomain (  )  [inline]

Definition at line 51 of file Reference.hpp.

References __insideDomain.

00052   {
00053     return __insideDomain;
00054   }

void Reference::resize ( const size_t  i  )  [inline]

Definition at line 56 of file Reference.hpp.

References __reference.

00057   {
00058     __reference.resize(i);
00059   }

size_t Reference::size (  )  const [inline]

Definition at line 61 of file Reference.hpp.

References __reference.

00062   {
00063     return __reference.size();
00064   }

void Reference::set ( const Representation r  )  [inline]

Definition at line 66 of file Reference.hpp.

References __reference, and ASSERT.

00067   {
00068     ASSERT(r.size() == __reference.size());
00069     __reference = r;
00070   }

bool Reference::isSet (  )  const [inline]

Definition at line 72 of file Reference.hpp.

References __reference.

00073   {
00074     for(Representation::const_iterator i = __reference.begin();
00075         i != __reference.end(); ++i) {
00076       if (*i) {
00077         return true;
00078       }
00079     }
00080     return false;  
00081   }

bool Reference::isSet ( const Reference::Representation r  )  const [inline]

Definition at line 83 of file Reference.hpp.

References __reference, and ASSERT.

00084   {
00085     ASSERT(r.size() == __reference.size());
00086 
00087     for (size_t i=0; i<r.size(); ++i) {
00088       if (r[i] && !__reference[i])
00089         return false;
00090     }
00091     return true;
00092   }

bool Reference::operator== ( const Reference R  )  const [inline]

Definition at line 94 of file Reference.hpp.

References __reference.

00095   {
00096     return (__reference == R.__reference);
00097   }

bool Reference::operator!= ( const Reference R  )  const [inline]

Definition at line 99 of file Reference.hpp.

References __reference.

00100   {
00101     return (__reference != R.__reference);
00102   }

const Reference& Reference::operator= ( const size_t &  i  )  [inline]

Definition at line 104 of file Reference.hpp.

References __reference.

00105   {
00106     __reference[i] = true;
00107     return *this;
00108   }

const Reference& Reference::operator= ( const Reference R  )  [inline]

Definition at line 110 of file Reference.hpp.

References __reference.

00111   {
00112     __reference = R.__reference;
00113     return *this;
00114   }

void Reference::set ( const size_t &  i,
const bool &  b 
) [inline]

Definition at line 116 of file Reference.hpp.

References __reference, and ASSERT.

00117   {
00118     ASSERT(i<__reference.size());
00119     __reference[i] = b;
00120   }

bool Reference::get ( const size_t &  i  )  const [inline]

Definition at line 123 of file Reference.hpp.

References __reference, and ASSERT.

00124   {
00125     ASSERT(i<__reference.size());
00126     return __reference[i];
00127   }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Reference R 
) [friend]

This function writes the reference of the object using a binary representation.

Definition at line 133 of file Reference.hpp.

00135   {
00136     size_t ref=0;
00137     for (size_t i = R.__reference.size()-1; i<R.__reference.size(); --i) {
00138       ref <<= 1;
00139       ref |= (R.__reference[i])?1:0;
00140     }
00141     
00142     os << ref;
00143     return os;
00144   }


Member Data Documentation

Definition at line 40 of file Reference.hpp.

Referenced by get(), isSet(), operator!=(), operator=(), operator==(), Reference(), resize(), set(), and size().

bool Reference::__insideDomain [private]

Definition at line 42 of file Reference.hpp.

Referenced by insideDomain().


The documentation for this class was generated from the following file:

Generated on Wed Nov 19 00:12:42 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6