13#ifndef ARCANE_UTILS_FLEXLMTOOLS_H_
14#define ARCANE_UTILS_FLEXLMTOOLS_H_
19#include "arcane/utils/String.h"
20#include "arcane/utils/Exception.h"
22#include "arcane/core/ArcaneVersion.h"
42class ARCANE_IMPL_EXPORT LicenseErrorException
51 ~LicenseErrorException() ARCANE_NOEXCEPT {}
55 virtual void explain(std::ostream& m)
const;
56 virtual void write(std::ostream& o)
const;
99 void setCheckInterval(
const Integer t = 120);
105 bool checkLicense(
const String name,
const Real version,
bool do_fatal =
true)
const;
116 void releaseLicense(
const String name,
Integer nb_licenses = 0);
120 void releaseAllLicenses();
127 typedef std::map<String, Integer> FeatureMapType;
128 FeatureMapType m_features;
138template <
typename FeatureModel>
153 bool checkLicense(
typename FeatureModel::eFeature feature,
const bool do_fatal)
const
155 const String name = FeatureModel::getName(feature);
156 const Real version = FeatureModel::getVersion(feature);
163 bool checkLicense(
typename FeatureModel::eFeature feature,
const Real version,
const bool do_fatal)
const
165 const String name = FeatureModel::getName(feature);
173 const String name = FeatureModel::getName(feature);
174 const Real version = FeatureModel::getVersion(feature);
182 const String name = FeatureModel::getName(feature);
189 const String name = FeatureModel::getName(feature);
190 const Real version = FeatureModel::getVersion(feature);
const String & where() const
Location of the exception.
const String & message() const
Exception message.
Exception(const String &name, const String &where)
virtual ~FlexLMMng()
Destructor.
static FlexLMMng * instance()
Access to the singleton.
void getLicense(const String name, const Real version, Integer nb_licenses=1)
Requests the allocation of.
bool checkLicense(const String name, const Real version, bool do_fatal=true) const
Tests the presence of a static feature.
bool m_is_master
Is this host the master for checks?
void releaseLicense(const String name, Integer nb_licenses=0)
Releases the licenses for the feature.
String featureInfo(const String name, const Real version) const
Return info on feature.
Abstract class of the parallelism supervisor.
virtual void explain(std::ostream &m) const
Explains the cause of the exception in the stream o.
Unicode character string.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.