1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
Jip J. Dekker f2a1c4e389 Squashed 'software/mza/' content from commit f970a59b17
git-subtree-dir: software/mza
git-subtree-split: f970a59b177c13ca3dd8aaef8cc6681d83b7e813
2021-07-11 16:34:30 +10:00

47 lines
1.7 KiB
C++

/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Guido Tack <guido.tack@monash.edu>
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __MINIZINC_OPTIONS_HH__
#define __MINIZINC_OPTIONS_HH__
#include <minizinc/hash.hh>
namespace MiniZinc {
class Options {
protected:
std::unordered_map<std::string, KeepAlive> _options;
Expression* getParam(const std::string& name) const;
public:
void setIntParam(const std::string& name, KeepAlive e);
void setFloatParam(const std::string& name, KeepAlive e);
void setBoolParam(const std::string& name, KeepAlive e);
void setStringParam(const std::string& name, KeepAlive e);
void setIntParam(const std::string& name, long long int e);
void setFloatParam(const std::string& name, double e);
void setBoolParam(const std::string& name, bool e);
void setStringParam(const std::string& name, std::string e);
long long int getIntParam(const std::string& name) const;
long long int getIntParam(const std::string& name, long long int def) const;
double getFloatParam(const std::string& name) const;
double getFloatParam(const std::string& name, double def) const;
bool getBoolParam(const std::string& name) const;
bool getBoolParam(const std::string& name, bool def) const;
std::string getStringParam(const std::string& name) const;
std::string getStringParam(const std::string& name, std::string def) const;
bool hasParam(const std::string& name) const;
std::ostream& dump(std::ostream& os);
};
} // namespace MiniZinc
#endif