Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
Timestamp.cc
1/*
2 * Copyright 2020 IFPEN-CEA
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * SPDX-License-Identifier: Apache-2.0
17 */
18
19#include "Timestamp.h"
20
21#include <arccore/base/FatalErrorException.h>
22#include <arccore/base/TraceInfo.h>
23
24#include <alien/utils/time_stamp/TimestampMng.h>
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Alien
30{
31
32using namespace Arccore;
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36Timestamp::Timestamp(const TimestampMng* manager)
37: m_timestamp(0)
38, m_manager(manager)
39{}
40
41/*---------------------------------------------------------------------------*/
42
44{
45 return m_timestamp;
46}
47
48/*---------------------------------------------------------------------------*/
49
51{
52 if (m_manager)
53 m_manager->updateTimestamp(this);
54}
55
56/*---------------------------------------------------------------------------*/
57
58void Timestamp::copyTimestamp(const Timestamp& v)
59{
60 m_timestamp = v.m_timestamp;
61}
62
63/*---------------------------------------------------------------------------*/
64
65void Timestamp::setTimestamp(const TimestampMng* manager, const Int64 timestamp)
66{
67 if (manager != m_manager)
68 throw FatalErrorException(
69 A_FUNCINFO, "Illegal TimestampMng used for updating timestamp");
70 m_timestamp = timestamp;
71}
72
73/*---------------------------------------------------------------------------*/
74/*---------------------------------------------------------------------------*/
75
76} // namespace Alien
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
Gestionnaire de Timestamp.
virtual Int64 timestamp() const
Donne la valeur courante du timestamp.
Definition Timestamp.cc:43
void updateTimestamp()
Met à jour le timestamp.
Definition Timestamp.cc:50
void copyTimestamp(const Timestamp &v)
Copy un autre timestamp.
Definition Timestamp.cc:58
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17