QDP++
qdp_map_obj_null.h
Go to the documentation of this file.
1// -*- C++ -*-
5
6#ifndef __qdp_map_obj_null_h__
7#define __qdp_map_obj_null_h__
8
9#include "qdp_map_obj.h"
10#include <vector>
11
12namespace QDP
13{
14
15 //----------------------------------------------------------------------------
17 template<typename K, typename V>
18 class MapObjectNull : public MapObject<K,V>
19 {
20 public:
23
26
28 int insert(const K& key, const V& val) {return 1;}
29
31 int get(const K& key, V& val) const {return 1;}
32
34 void flush() {}
35
37 bool exist(const K& key) const {return false;}
38
40 unsigned int size() const {return 0;}
41
43 void keys(std::vector<K>& _keys) const {}
44
46 int insertUserdata(const std::string& user_data) {return 0;}
47
49 int getUserdata(std::string& user_data) const {return 0;}
50 };
51
52} // namespace QDP
53
54#endif
void flush()
Flush out state of object.
int insertUserdata(const std::string &user_data)
Insert user data into the metadata database.
int get(const K &key, V &val) const
Accessor.
~MapObjectNull()
Destructor.
int getUserdata(std::string &user_data) const
Get user user data from the metadata database.
bool exist(const K &key) const
Exists?
MapObjectNull()
Default constructor.
void keys(std::vector< K > &_keys) const
Dump keys.
unsigned int size() const
The number of elements.
int insert(const K &key, const V &val)
Insert.
A wrapper over maps.
Definition qdp_map_obj.h:21
Yet another random number generator.
Wrapper over maps.