TrioCFD 1.9.9_beta
TrioCFD documentation
Loading...
Searching...
No Matches
MD_Vector Class Reference

: This class is an OWN_PTR but the pointed object is shared among multiple More...

#include <MD_Vector.h>

Public Member Functions

 MD_Vector ()
 MD_Vector (const MD_Vector &)
 Copy constructor, attaches the pointer to the same object as the source.
MD_Vectoroperator= (const MD_Vector &)
 Same as attach(src).
void attach (const MD_Vector &)
 Detaches the pointer and attaches to the same object as src.
void detach ()
 Detaches the pointer from the pointed object.
int non_nul () const
 operator bool () const noexcept
void copy (const MD_Vector_base &)
 Constructs an MD_Vector object by copying an existing object.
const MD_Vector_basevaleur () const
const MD_Vector_baseoperator-> () const
int operator== (const MD_Vector &) const
 Returns 1 if the structures are identical, 0 otherwise.
int operator!= (const MD_Vector &) const
 Inverse of ==.

Detailed Description

: This class is an OWN_PTR but the pointed object is shared among multiple

instances of this class. The pointed object can only be accessed as "const" and is only accessible through MD_Vector instances. Therefore there is no way to access it as "non-const" other than with a cast. The attach() method and the copy constructor attach the pointer to an existing instance already attached to a pointer. The attach_detach() method takes ownership of the object pointed to by the OWN_PTR and detaches the object from the OWN_PTR. This is the only way to "construct" MD_Vector objects (avoids a copy and ensures that the MD_Vect can no longer be modified once it has been attached to an MD_Vector). WARNING: the safety of this method relies on the fact that the instance pointed to by MD_Vector is accessible nowhere else but through MD_Vector objects. DO NOT ADD a method attach(const MD_Vector_base &), as this breaks the class safety!!! (B.Mathieu) As many methods as possible are inlined to avoid penalising non-distributed arrays, while avoiding including MD_Vector_base.h.

Definition at line 47 of file MD_Vector.h.

Constructor & Destructor Documentation

◆ MD_Vector() [1/2]

MD_Vector::MD_Vector ( )
inline

Definition at line 50 of file MD_Vector.h.

◆ MD_Vector() [2/2]

MD_Vector::MD_Vector ( const MD_Vector & src)
inline

Copy constructor, attaches the pointer to the same object as the source.

Definition at line 95 of file MD_Vector.h.

Member Function Documentation

◆ attach()

void MD_Vector::attach ( const MD_Vector & src)
inline

Detaches the pointer and attaches to the same object as src.

Definition at line 111 of file MD_Vector.h.

◆ copy()

void MD_Vector::copy ( const MD_Vector_base & src)

Constructs an MD_Vector object by copying an existing object.

This is the recommended method for creating an MD_Vector object (other than by copying another MD_Vector).

Definition at line 26 of file MD_Vector.cpp.

◆ detach()

void MD_Vector::detach ( )
inline

Detaches the pointer from the pointed object.

Definition at line 102 of file MD_Vector.h.

◆ non_nul()

int MD_Vector::non_nul ( ) const
inline

Definition at line 56 of file MD_Vector.h.

◆ operator bool()

MD_Vector::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 65 of file MD_Vector.h.

◆ operator!=()

int MD_Vector::operator!= ( const MD_Vector & md) const

Inverse of ==.

Definition at line 50 of file MD_Vector.cpp.

◆ operator->()

const MD_Vector_base * MD_Vector::operator-> ( ) const
inline

Definition at line 83 of file MD_Vector.h.

◆ operator=()

MD_Vector & MD_Vector::operator= ( const MD_Vector & src)
inline

Same as attach(src).

Definition at line 122 of file MD_Vector.h.

◆ operator==()

int MD_Vector::operator== ( const MD_Vector & md) const

Returns 1 if the structures are identical, 0 otherwise.

Definition at line 37 of file MD_Vector.cpp.

◆ valeur()

const MD_Vector_base & MD_Vector::valeur ( ) const
inline

Definition at line 77 of file MD_Vector.h.


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