ATLAS Offline Software
Loading...
Searching...
No Matches
PySTLAdaptor.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id$
14
15
16#ifndef PYDUMPER_PYSTLADAPTOR_H
17#define PYDUMPER_PYSTLADAPTOR_H
18
19
20namespace PyDumper {
21
22
35template <class C>
37{
38public:
40 {
41 public:
42 iterator (typename C::const_iterator it) : m_it (it) {}
43 typename C::const_iterator::value_type operator*() { return *m_it; }
44 iterator& operator++() { ++m_it; return *this; }
45 bool operator!= (const iterator& other) const { return m_it != other.m_it; }
46 private:
47 typename C::const_iterator m_it;
48 };
49
50
51 PySTLAdaptor (const C& c) : m_c (&c) {}
52 iterator begin() const { return m_c->begin(); }
53 iterator end() const { return m_c->end(); }
54
55
56private:
57 const C* m_c;
58};
59
60
61} // namespace PyDumper
62
63
64#endif // not PYDUMPER_PYSTLADAPTOR_H
iterator(typename C::const_iterator it)
bool operator!=(const iterator &other) const
C::const_iterator::value_type operator*()
iterator end() const
iterator begin() const
struct color C