Debian Codegraph @

include/BALL/PYTHON/EXTENSIONS/pyIndexList.h

raw symbols SCIP
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: pyIndexList.h,v 1.2 2005/12/23 17:01:57 amoll Exp $
5 //
6
7 #ifndef BALL_PYTHON_PYINDEXLIST_H
8 #define BALL_PYTHON_PYINDEXLIST_H
9
10 #ifndef BALL_COMMON_H
11 # include <BALL/common.h>
12 #endif
13
14 #ifndef BALL_DATAYPE_STRING_H
15 # include <BALL/DATATYPE/string.h>
16 #endif
17
18 namespace BALL
19 {
20 /** Equivalent for an STL::List of numbers/indices in Python.
21 This is used to express both, lits and arrays of signed/unsigned
22 integers in Python.
23 \ingroup PythonExtensions
24 */
25 class PyIndexList
26 : public std::list<Index>
27 {
28 public:
29
30 BALL_CREATE(PyIndexList)
31
32 /** @name Type Definitions
33 */
34 //@{
35
36 /** Index type
37 */
38 typedef Index ValueType;
39
40 /** Pointer type
41 */
42 typedef Index PointerType;
43
44 /** Iterator type.
45 */
46 typedef std::list<Index>::iterator Iterator;
47
48 /** Constant iterator type.
49 */
50 typedef std::list<Index>::const_iterator ConstIterator;
51
52 //@}
53
54 /** @name Constructors and Destructors */
55 //@{
56
57 /** Default constructor.
58 Create an empty list.
59 */
60 PyIndexList();
61
62 /// Copy constructor
63 PyIndexList(const PyIndexList& new_list);
64
65 /** Construct from a vector of Index.
66 This constructor creates an PyIndexList object from
67 a vector of Index.
68 */
69 PyIndexList(const std::vector<Index>& indices);
70
71 /** Construct from a list of Index.
72 This constructor creates an PyIndexList object from
73 a list of Index objects.
74 */
75 PyIndexList(const std::list<Index>& fragment);
76
77 /** Construct from a vector of Index.
78 This constructor creates an PyIndexList object from
79 a vector of Index.
80 */
81 PyIndexList(const std::vector<Position>& indices);
82
83 /** Construct from a list of Index.
84 This constructor creates an PyIndexList object from
85 a list of Index objects.
86 */
87 PyIndexList(const std::list<Position>& fragment);
88
89 /** Destructor
90 */
91 virtual ~PyIndexList() throw();
92 //@}
93
94 /** @name Assignment
95 */
96 //@{
97
98 ///
99 PyIndexList& operator = (const std::list<Index>& idx_list);
100 ///
101 PyIndexList& operator = (const std::list<Position>& idx_list);
102 ///
103 PyIndexList& operator = (const std::vector<Index>& idx_list);
104 ///
105 PyIndexList& operator = (const std::vector<Position>& idx_list);
106 //@}
107 };
108
109 } // namespace BALL
110
111 #endif // BALL_PYTHON_PYINDEXLIST_H