OOFEM 3.0
Loading...
Searching...
No Matches
dictionary.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef dictionr_h
36#define dictionr_h
37
38#include "oofemenv.h"
39#include "pair.h"
40#include "error.h"
41#include "contextioresulttype.h"
42#include "contextmode.h"
43
44#include <string>
45#include <iosfwd>
46
47namespace oofem {
48class DataStream;
49
59{
60protected:
65
66public:
68 Dictionary() : first(NULL), last(NULL) { }
71
73 Dictionary(const Dictionary& other) {
74 Pair *next = other.first;
75 while ( next ) {
76 this->add(next->giveKey(), next->giveValue());
77 next = next->giveNext();
78 }
79 }
80
83 this->clear();
84 Pair *next = other.first;
85 while ( next ) {
86 this->add(next->giveKey(), next->giveValue());
87 next = next->giveNext();
88 }
89
90 return *this;
91 }
92
94 void clear();
101 Pair *add(int aKey, double value);
108 double &at(int aKey);
109 double at(int aKey) const;
115 bool includes(int aKey) const;
117 void printYourself();
119 void formatAsString(std :: string &str);
121 int giveSize();
122
127 void saveContext(DataStream &stream);
132 void restoreContext(DataStream &stream);
133
134 friend std :: ostream &operator << ( std :: ostream & out, const Dictionary & r );
135};
136} // end namespace oofem
137#endif // dictionr_h
Dictionary()
Constructor, creates empty dictionary.
Definition dictionary.h:68
void clear()
Clears the receiver.
Definition dictionary.C:52
Dictionary(const Dictionary &other)
copy constructor
Definition dictionary.h:73
Dictionary & operator=(const Dictionary &other)
copy assignment constructor
Definition dictionary.h:82
Pair * first
First pair.
Definition dictionary.h:62
Pair * add(int aKey, double value)
Definition dictionary.C:79
Pair * last
Last pair.
Definition dictionary.h:64
Pair * giveNext()
Returns pointer to the next pair.
Definition pair.h:72
int giveKey()
Returns the receiver key.
Definition pair.h:70
double & giveValue()
Returns associated value.
Definition pair.h:74
#define OOFEM_EXPORT
Definition oofemcfg.h:7

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011