Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/vis15/src/lib/include/diderot/options.hxx
ViewVC logotype

Annotation of /branches/vis15/src/lib/include/diderot/options.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3928 - (view) (download) (as text)

1 : jhr 3895 /*! \file options.hxx
2 :     *
3 :     * \author John Reppy
4 :     */
5 :    
6 :     /*
7 :     * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
8 :     *
9 :     * COPYRIGHT (c) 2016 The University of Chicago
10 :     * All rights reserved.
11 :     */
12 :    
13 :     #ifndef _DIDEROT_OPTIONS_HXX_
14 :     #define _DIDEROT_OPTIONS_HXX_
15 :    
16 :     #ifndef _DIDEROT_BASE_HXX_
17 :     #include "base.hxx"
18 :     #endif
19 :    
20 :     #include <vector>
21 :     #include <string>
22 :    
23 :     namespace diderot {
24 :    
25 : jhr 3928 // options_base is the base class for type-specific option info
26 :     namespace __details { struct option_base; }
27 :    
28 : jhr 3895 template <typename REAL, typename INT>
29 :     class options {
30 :     public:
31 : jhr 3916 options (const char *info = nullptr);
32 : jhr 3895 ~options ();
33 :    
34 :     void addFlag (const char *name, const char *desc, bool *gv);
35 :     void add (const char *name, const char *desc, bool *gv, bool hasDflt);
36 :     void add (const char *name, const char *desc, uint32_t *gv, bool hasDflt);
37 :     void add (const char *name, const char *desc, INT *gv, bool hasDflt);
38 :     void add (const char *name, const char *desc, int dim, REAL *gv, bool hasDflt);
39 :     void add (const char *name, const char *desc, std::string *gv, bool hasDflt);
40 :    
41 :     void process (int argc, const char **argv);
42 :    
43 :     private:
44 :     std::string _progInfo;
45 : jhr 3928 std::vector<__details::option_base *> _opts;
46 : jhr 3895 };
47 :    
48 :     } // namespace diderot
49 :    
50 : jhr 3928 // include the source code for template instantiation
51 :     //
52 :    
53 : jhr 3895 #endif // !_DIDEROT_OPTIONS_HXX_

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0