aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-12 18:11:50 +0000
committerlloyd <[email protected]>2008-11-12 18:11:50 +0000
commitff1e835d888a2783e59efc30fa125bfaf7d150fe (patch)
treef69008ec6cfc733bd993a584e7298c1d48afc89d /src/utils
parente99e232ac74cb2761468e2edad4881fc26033df3 (diff)
Remove support for provider identifiers from SCAN_Name - it turns out this
was not the right place to keep track of this information. Also modify all Algorithm_Factory constructor functions to take instead of a SCAN_Name a pair of std::strings - the SCAN name and an optional provider name. If a provider is specified, either that provider will be used or the request will fail. Otherwise, the library will attempt best effort, based on user-set algorithm implementation settings (combine with benchmark.h for choosing the fastest implementation at runtime) or if not set, a static ordering (preset in static_provider_weight in prov_weight.cpp, though it would be nice to make this easier to toggle).
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/scan_name.cpp14
-rw-r--r--src/utils/scan_name.h28
2 files changed, 5 insertions, 37 deletions
diff --git a/src/utils/scan_name.cpp b/src/utils/scan_name.cpp
index f5a1a9245..c0e931e14 100644
--- a/src/utils/scan_name.cpp
+++ b/src/utils/scan_name.cpp
@@ -40,11 +40,9 @@ parse_and_deref_aliases(const std::string& algo_spec)
}
-SCAN_Name::SCAN_Name(const std::string& algo_spec,
- const std::string& provider)
+SCAN_Name::SCAN_Name(const std::string& algo_spec)
{
orig_algo_spec = algo_spec;
- m_provider = provider;
name = parse_and_deref_aliases(algo_spec);
@@ -52,15 +50,7 @@ SCAN_Name::SCAN_Name(const std::string& algo_spec,
throw Decoding_Error("Bad SCAN name " + algo_spec);
}
-SCAN_Name SCAN_Name::arg(u32bit i) const
- {
- if(i > arg_count())
- throw std::range_error("SCAN_Name::argument");
-
- return SCAN_Name(name[i+1], m_provider);
- }
-
-std::string SCAN_Name::arg_as_string(u32bit i) const
+std::string SCAN_Name::arg(u32bit i) const
{
if(i > arg_count())
throw std::range_error("SCAN_Name::argument");
diff --git a/src/utils/scan_name.h b/src/utils/scan_name.h
index b01411c94..4e391c37d 100644
--- a/src/utils/scan_name.h
+++ b/src/utils/scan_name.h
@@ -22,10 +22,8 @@ class SCAN_Name
public:
/**
@param algo_spec A SCAN name
- @param providers An optional provider name
*/
- SCAN_Name(const std::string& algo_spec,
- const std::string& providers = "");
+ SCAN_Name(const std::string& algo_spec);
/**
@return the original input string
@@ -33,11 +31,6 @@ class SCAN_Name
std::string as_string() const { return orig_algo_spec; }
/**
- @return the provider name (or empty)
- */
- std::string provider() const { return m_provider; }
-
- /**
@return the algorithm name
*/
std::string algo_name() const { return name[0]; }
@@ -48,15 +41,6 @@ class SCAN_Name
u32bit arg_count() const { return name.size() - 1; }
/**
- @param provider a provider name
- @returns if this provider was allowed by the request
- */
- bool provider_allowed(const std::string& provider) const
- {
- return (m_provider == "" || m_provider == provider);
- }
-
- /**
@return if the number of arguments is between lower and upper
*/
bool arg_count_between(u32bit lower, u32bit upper) const
@@ -66,13 +50,7 @@ class SCAN_Name
@param i which argument
@return the ith argument
*/
- std::string arg_as_string(u32bit i) const;
-
- /**
- @param i which argument
- @return the ith argument
- */
- SCAN_Name arg(u32bit i) const;
+ std::string arg(u32bit i) const;
/**
@param i which argument
@@ -80,7 +58,7 @@ class SCAN_Name
*/
u32bit arg_as_u32bit(u32bit i, u32bit def_value) const;
private:
- std::string orig_algo_spec, m_provider;
+ std::string orig_algo_spec;
std::vector<std::string> name;
};