Overture  Version 25
IndexArg.h
Go to the documentation of this file.
1 #ifndef INDEX_ARG_H
2 #define INDEX_ARG_H "IndexArg.h"
3 
4 #include "A++.h"
5 
6 //==================================================================================
7 // This class is used as the argument to the operator() instead of using an Index,
8 // Range or int.
9 // This class is used to reduce the number of () operators that need to be written
10 // This class knows how to convert an int, Index or Range to a member of this class
11 //
12 //==================================================================================
13 class IndexArg
14 {
15 public:
16  Index I;
17  Range R;
18 
19  IndexArg(){ }
20  IndexArg( const int i ) // convert an int to an IndexArg
21  {
22  I=Range(i,i); R=Range(i,i);
23  }
24  IndexArg( const Index & I0 ) // convert an Index to an IndexArg
25  {
26  I=I0; R=Range(I0.getBase(),I0.getBound());
27  }
28  IndexArg( const Range & R0 ) // convert a Range to an IndexArg
29  {
30  I=R0; R=R0;
31  }
33 };
34 
35 
36 #endif