Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82612845
aka_static_memory_inline_impl.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Sep 12, 10:33
Size
2 KB
Mime Type
text/x-c
Expires
Sat, Sep 14, 10:33 (2 d)
Engine
blob
Format
Raw Data
Handle
20355149
Attached To
rAKA akantu
aka_static_memory_inline_impl.hh
View Options
/**
* @file aka_static_memory_inline_impl.hh
*
* @author Nicolas Richart <nicolas.richart@epfl.ch>
*
* @date creation: Thu Jul 15 2010
* @date last modification: Wed Feb 03 2016
*
* @brief Implementation of inline functions of the class StaticMemory
*
*
* Copyright (©) 2010-2018 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* Akantu is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Akantu is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Akantu. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "aka_static_memory.hh"
namespace
akantu
{
/* -------------------------------------------------------------------------- */
inline
const
ArrayMap
&
StaticMemory
::
getMemory
(
const
MemoryID
&
memory_id
)
const
{
AKANTU_DEBUG_IN
();
auto
memory_it
=
memories
.
find
(
memory_id
);
if
(
memory_it
==
memories
.
end
())
{
AKANTU_SILENT_EXCEPTION
(
"StaticMemory as no memory with ID "
<<
memory_id
);
}
AKANTU_DEBUG_OUT
();
return
memory_it
->
second
;
}
/* -------------------------------------------------------------------------- */
inline
const
ArrayBase
&
StaticMemory
::
getArray
(
const
MemoryID
&
memory_id
,
const
ID
&
name
)
const
{
AKANTU_DEBUG_IN
();
const
ArrayMap
&
vectors
=
this
->
getMemory
(
memory_id
);
auto
vectors_it
=
vectors
.
find
(
name
);
if
(
vectors_it
==
vectors
.
end
())
{
AKANTU_SILENT_EXCEPTION
(
"StaticMemory as no array named "
<<
name
<<
" for the Memory "
<<
memory_id
);
}
AKANTU_DEBUG_OUT
();
return
*
(
vectors_it
->
second
);
}
/* -------------------------------------------------------------------------- */
}
// namespace akantu
Event Timeline
Log In to Comment