File indexing completed on 2024-04-28 05:32:12
0001 #ifndef Counter_h 0002 #define Counter_h 0003 0004 /* 0005 * this file is part of the oxygen gtk engine 0006 * SPDX-FileCopyrightText: 2012 Hugo Pereira Da Costa <hugo.pereira@free.fr> 0007 * 0008 * SPDX-License-Identifier: LGPL-2.0-or-later 0009 */ 0010 0011 0012 #include <string> 0013 #include <map> 0014 0015 0016 namespace Oxygen 0017 { 0018 0019 class ObjectCounter 0020 { 0021 0022 public: 0023 0024 //! counter name and counts pair 0025 typedef std::pair<std::string, int> Pair; 0026 0027 //! constructor 0028 ObjectCounter( const std::string& name ); 0029 0030 //! constructor 0031 ObjectCounter( const ObjectCounter& counter ); 0032 0033 //! destructor 0034 virtual ~ObjectCounter( void ); 0035 0036 //! retrieves counter count 0037 int count( void ) const; 0038 0039 private: 0040 0041 //! pointer to integer counter 0042 int* count_; 0043 0044 }; 0045 0046 } 0047 0048 #endif