summaryrefslogtreecommitdiff
path: root/include/media/requestCounter.h
blob: a69b4aab01e7971828592baec42b29f7ff4e9d2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * requestCounter.h
 *
 *  Created on: 04.11.2012
 *      Author: savop
 */

#ifndef REQUESTCOUNTER_H_
#define REQUESTCOUNTER_H_

#include "../tools/atomic.h"

namespace upnp {

struct request_counter_t {
  // Should be std::atomic<int>. Unfortunatelly, it's supported on C++11 only.
  // Hope, it works anyway.
  static tools::atomic::AtomicInteger OPEN_REQUESTS;
  request_counter_t(){++OPEN_REQUESTS;}
  ~request_counter_t(){--OPEN_REQUESTS;}
};

}  // namespace upnp

#endif /* REQUESTCOUNTER_H_ */