2 * Copyright (c) 2018 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef __VOM_STAT_READER_H__
17 #define __VOM_STAT_READER_H__
19 #include "vom/stat_client.hpp"
27 * Stat reader: single interface to get stats
40 stat_reader(stat_client sc);
48 * connection to stat object
50 virtual int connect();
53 * disconnect to stat object
55 virtual void disconnect();
58 * read stats for registered objects from stat_segment
59 * and set those stats to respective objects
65 * friend to interface class to call stat_register and
66 * stat_unregister methods
68 friend class interface;
71 * Register objects to get stats for
73 static void registers(const interface& itf);
78 static void unregisters(const interface& itf);
81 * typedef of stat_indexes
83 typedef std::set<uint32_t> stat_indexes_t;
91 * static pointer to set of registered interfaces
93 static stat_indexes_t m_stat_itf_indexes;
97 * fd.io coding-style-patch-verification: ON
100 * eval: (c-set-style "mozilla")