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

La memoire de Trio-U. More...

#include <Memoire.h>

Public Member Functions

int add (Objet_U *)
 Adds an Objet_U to the TRUST memory.
int suppr (int)
 Removes from memory the Objet_U with index num. The Objet_U itself is not deleted; only its pointer in memory is removed.
Objet_Uobjet_u (int)
 Returns a reference to the Objet_U at index num in memory.
const Objet_Uobjet_u (int) const
 Returns a const reference to the Objet_U at index num in memory.
Objet_Uobjet_u_ptr (int)
 Returns a pointer to the Objet_U at index num in memory.
const Objet_Uobjet_u_ptr (int) const
 Returns a const pointer to the Objet_U at index num in memory.
int rang (const Nom &type, const Nom &nom) const
 Returns the index in memory of the object with the given type and name.
int rang (const Nom &nom) const
 Returns the index in memory of the object with the given name.
void compacte ()
 Compacts memory. This compaction is performed automatically when it becomes necessary.
int verifie () const
 Verifies the content of all memory slots.
int imprime () const
 Prints a memory state summary to the error output stream.

Static Public Member Functions

static MemoireInstance ()
 Returns a pointer to the memory instance. Creates a new memory object if no instance has been created yet.

Protected Member Functions

 Memoire ()
 Constructor. Initializes a working area for Objet_U, "double", and "int" objects.

Friends

Sortieoperator<< (Sortie &os, const Memoire &mem)
 Output operator that prints the state of memory mem to output stream os.

Detailed Description

La memoire de Trio-U.

Definition at line 29 of file Memoire.h.

Constructor & Destructor Documentation

◆ Memoire()

Memoire::Memoire ( )
protected

Constructor. Initializes a working area for Objet_U, "double", and "int" objects.

Definition at line 42 of file Memoire.cpp.

Member Function Documentation

◆ add()

int Memoire::add ( Objet_U * obj)

Adds an Objet_U to the TRUST memory.

Parameters
(Objet_U*obj) pointer to the Objet_U to add
Returns
(int) the index assigned to the object in memory

Definition at line 54 of file Memoire.cpp.

◆ compacte()

void Memoire::compacte ( )

Compacts memory. This compaction is performed automatically when it becomes necessary.

Definition at line 306 of file Memoire.cpp.

◆ imprime()

int Memoire::imprime ( ) const

Prints a memory state summary to the error output stream.

Returns
(int) return code; always returns 1

Definition at line 347 of file Memoire.cpp.

◆ Instance()

Memoire & Memoire::Instance ( )
static

Returns a pointer to the memory instance. Creates a new memory object if no instance has been created yet.

Returns
(Memoire*) pointer to the memory instance

Definition at line 32 of file Memoire.cpp.

◆ objet_u() [1/2]

Objet_U & Memoire::objet_u ( int num)

Returns a reference to the Objet_U at index num in memory.

Parameters
(intnum) the index of the object in memory
Returns
(Objet_U&) reference to the found Objet_U
Exceptions
Exitswith an error if the memory has an error at index num

Definition at line 206 of file Memoire.cpp.

◆ objet_u() [2/2]

const Objet_U & Memoire::objet_u ( int num) const

Returns a const reference to the Objet_U at index num in memory.

Parameters
(intnum) the index of the object in memory
Returns
(const Objet_U&) const reference to the found Objet_U
Exceptions
Exitswith an error if the memory has an error at index num

Definition at line 232 of file Memoire.cpp.

◆ objet_u_ptr() [1/2]

Objet_U * Memoire::objet_u_ptr ( int num)

Returns a pointer to the Objet_U at index num in memory.

Parameters
(intnum) the index of the object in memory
Returns
(Objet_U*) pointer to the found Objet_U
Exceptions
Exitswith an error if the memory has an error at index num

Definition at line 258 of file Memoire.cpp.

◆ objet_u_ptr() [2/2]

const Objet_U * Memoire::objet_u_ptr ( int num) const

Returns a const pointer to the Objet_U at index num in memory.

Parameters
(intnum) the index of the object in memory
Returns
(const Objet_U*) const pointer to the found Objet_U
Exceptions
Exitswith an error if the memory has an error at index num

Definition at line 284 of file Memoire.cpp.

◆ rang() [1/2]

int Memoire::rang ( const Nom & nom) const

Returns the index in memory of the object with the given name.

Parameters
(constNom& nom) the name of the object
Returns
(int) the index of the object if found in memory, -1 otherwise

Definition at line 186 of file Memoire.cpp.

◆ rang() [2/2]

int Memoire::rang ( const Nom & type,
const Nom & nom ) const

Returns the index in memory of the object with the given type and name.

Parameters
(constNom& type) the type of the object
(constNom& nom) the name of the object
Returns
(int) the index of the object if found in memory, -1 otherwise

Definition at line 166 of file Memoire.cpp.

◆ suppr()

int Memoire::suppr ( int num)

Removes from memory the Objet_U with index num. The Objet_U itself is not deleted; only its pointer in memory is removed.

Parameters
(intnum) the index of the Objet_U to remove
Returns
(int) return code, always returns 1

Definition at line 105 of file Memoire.cpp.

◆ verifie()

int Memoire::verifie ( ) const

Verifies the content of all memory slots.

Returns
(int) return code; always returns 1

Definition at line 388 of file Memoire.cpp.

◆ operator<<

Sortie & operator<< ( Sortie & os,
const Memoire & mem )
friend

Output operator that prints the state of memory mem to output stream os.

Parameters
(Sortie&os) the output stream to use
(constMemoire& mem) the memory to examine
Returns
(Sortie&) the modified output stream

Definition at line 412 of file Memoire.cpp.


The documentation for this class was generated from the following files:
  • /home/docs/trust-code/src/Kernel/Utilitaires/Memoire.h
  • /home/docs/trust-code/src/Kernel/Utilitaires/Memoire.cpp