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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3933 - (download) (as text) (annotate)
Sun Jun 5 19:29:10 2016 UTC (3 years, 3 months ago) by jhr
File size: 1364 byte(s)
  working on merge: runtime
/*! \file options.hxx
 *
 * \author John Reppy
 */

/*
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2016 The University of Chicago
 * All rights reserved.
 */

#ifndef _DIDEROT_OPTIONS_HXX_
#define _DIDEROT_OPTIONS_HXX_

#ifndef _DIDEROT_BASE_HXX_
#include "base.hxx"
#endif

#include <vector>
#include <string>

namespace diderot {

 // options_base is the base class for type-specific option info
    namespace __details { struct option_base; }

    template <typename REAL, typename INT>
    class options {
      public:
	options (const char *info = nullptr);
	~options ();

	void addFlag (const char *name, const char *desc, bool *gv);
	void add (const char *name, const char *desc, bool *gv, bool hasDflt);
	void add (const char *name, const char *desc, uint32_t *gv, bool hasDflt);
	void add (const char *name, const char *desc, INT *gv, bool hasDflt);
	void add (const char *name, const char *desc, int dim, REAL *gv, bool hasDflt);
	void add (const char *name, const char *desc, std::string *gv, bool hasDflt);

	void process (int argc, const char **argv);

      private:
	std::string _progInfo;
	std::vector<__details::option_base *> _opts;
    };

} // namespace diderot

// include the source code for template instantiation
//
#include "options-inst.hxx"

#endif // !_DIDEROT_OPTIONS_HXX_

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