ISAAC
Overview :: Library Doc :: Server Doc :: JSON Commands

In Situ Animation of Accelerated Computations

MetaDataClient.cpp
Go to the documentation of this file.
1 /* This file is part of ISAAC.
2  *
3  * ISAAC is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as
5  * published by the Free Software Foundation, either version 3 of the
6  * License, or (at your option) any later version.
7  *
8  * ISAAC is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with ISAAC. If not, see <www.gnu.org/licenses/>. */
15 
16 #include "MetaDataClient.hpp"
17 #include <algorithm>
18 
20 {
21 
22 }
23 
24 void MetaDataClient::observe(int nr,int stream, bool dropable)
25 {
26  observeList.insert( std::pair<int,int>(nr,stream) );
27  dropableList.insert( std::pair<int,bool>(nr,dropable) );
28 }
29 
30 void MetaDataClient::stopObserve(int nr,int& stream,bool& dropable)
31 {
32  auto it = observeList.find( nr );
33  if (it != observeList.end())
34  stream = it->second;
35  auto it2 = dropableList.find( nr );
36  if (it2 != dropableList.end())
37  dropable = it2->second;
38  observeList.erase(nr);
39  dropableList.erase(nr);
40 }
41 
42 bool MetaDataClient::doesObserve(int nr,int& stream,bool& dropable)
43 {
44  auto it = observeList.find( nr );
45  if (it == observeList.end())
46  return false;
47  auto it2 = dropableList.find( nr );
48  if (it2 == dropableList.end())
49  return false;
50  stream = it->second;
51  dropable = it2->second;
52  return true;
53 }
bool doesObserve(int nr, int &stream, bool &dropable)
void observe(int nr, int stream, bool dropable)
void stopObserve(int nr, int &stream, bool &dropable)