TextIndex.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2007 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Util/units/TextIndex.h
10
11#ifndef __TextIndex_h
12#define __TextIndex_h
13
14#include "TextInterface.h"
15
18{
19 public:
20
22 TextIndex (const std::string& named_range);
23
26
28
29 void set_size_name (const std::string& name);
30
32 unsigned size () const;
33
35 std::string get_index (unsigned i);
36
38 std::string get_current_index ();
39
40 protected:
41
44
46 std::string name;
47
49 std::string size_name;
50
52 std::string range;
53
55 std::vector<unsigned> indeces;
56
57};
58
59#endif
Manages Reference::To references to the instance.
Definition ReferenceAble.h:35
std::string get_index(unsigned i)
Get the index command for the specified index.
Definition TextIndex.C:51
std::string name
The name of the index.
Definition TextIndex.h:46
unsigned size() const
Get the number of indeces.
Definition TextIndex.C:65
std::vector< unsigned > indeces
The indeces.
Definition TextIndex.h:55
std::string size_name
The name of the index dimension in the container.
Definition TextIndex.h:49
std::string range
The range of the index set.
Definition TextIndex.h:52
TextIndex(const std::string &named_range)
Construct from string of the form 'name=[range]'.
Definition TextIndex.C:14
void set_container(TextInterface::Parser *)
Set the interface to the container to which the named index applies.
Definition TextIndex.C:34
Reference::To< TextInterface::Parser, false > container
The text interface to the container.
Definition TextIndex.h:43
std::string get_current_index()
Get the index command for the current index.
Definition TextIndex.C:60
void set_size_name(const std::string &name)
Set the name of the index dimension size in the container interface.
Definition TextIndex.C:45
An array of Value interfaces.
Definition TextInterfaceParser.h:31

Generated using doxygen 1.14.0