Commit cee44955 authored by Christophe Gonzales's avatar Christophe Gonzales

trying to remove error C2512 from mvsc compilation

parent 56085164
Pipeline #20245452 failed with stages
in 9 minutes and 9 seconds
......@@ -139,9 +139,28 @@ namespace gum {
* fields of the DBTranslator
*/
template <template<typename> class XALLOC>
DBTranslator (
DBTranslatedValueType val_type,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool editable_dictionary = true,
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
const allocator_type& alloc = allocator_type () );
/// default constructor without missing symbols
/** @param val_type indicates whether the DBTranslator deals with discrete
* or continuous variables
* @param editable_dictionary indicates whether the dictionary used for
* translations can be updated dynamically when observing new string or
* whether it should remain constant. To see how this parameter is handled,
* see the child classes inheriting from DBTranslator
* @param max_dico_entries the max number of entries that the dictionary
* can contain. If we try to add new entries in the dictionary, this will
* be considered as an error and a SizeError exception will be raised
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator
*/
DBTranslator ( DBTranslatedValueType val_type,
std::vector<std::string,XALLOC<std::string>> missing_symbols =
std::vector<std::string,XALLOC<std::string>> (),
const bool editable_dictionary = true,
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
......
......@@ -149,10 +149,25 @@ namespace gum {
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4ContinuousVariable
*/
template <template<typename> class XALLOC = ALLOC>
template <template<typename> class XALLOC>
DBTranslator4ContinuousVariable (
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool fit_range = false,
const allocator_type& alloc = allocator_type () );
/// default constructor without any initial variable nor missing symbol
/** When using this constructor, it is assumed implicitly that the
* continuous variable has a range from minus infinity to plus infinity.
* If the fit_range parameter is on, the range of the variable is updated
* so that it precisely fits the range of the observed values in the
* database.
* @param fit_range if true, the range of the variable is updated
* so that it precisely fits the range of the observed values in the
* database, else the range is kept to (-inf,inf)
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4ContinuousVariable
*/
DBTranslator4ContinuousVariable (
std::vector<std::string,XALLOC<std::string>> missing_symbols =
std::vector<std::string,XALLOC<std::string>> (),
const bool fit_range = false,
const allocator_type& alloc = allocator_type () );
......@@ -170,12 +185,30 @@ namespace gum {
* of the continuous variable, it will be discarded. If the fit_range
* parameter is on, the range of the variable is updated so that it
* can contain the range of the observed values in the database. */
template <typename GUM_SCALAR = float,
template<typename> class XALLOC = ALLOC>
template <typename GUM_SCALAR, template<typename> class XALLOC>
DBTranslator4ContinuousVariable (
const ContinuousVariable<GUM_SCALAR>& var,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool fit_range = false,
const allocator_type& alloc = allocator_type () );
/** @brief default constructor with a discrete variable as translator
* but without missing symbol
*
* @param var a labelized variable whose labels will be used for
* translations. The translator keeps a copy of this variable
* @param fit_range if true, the range of the variable is updated
* so that it precisely fits the range of the observed values in the
* database, else the range is kept to (-inf,inf)
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4ContinuousVariable
* @warning If a missing value symbol is a number included in the range
* of the continuous variable, it will be discarded. If the fit_range
* parameter is on, the range of the variable is updated so that it
* can contain the range of the observed values in the database. */
template <typename GUM_SCALAR>
DBTranslator4ContinuousVariable (
const ContinuousVariable<GUM_SCALAR>& var,
std::vector<std::string,XALLOC<std::string>> missing_symbols =
std::vector<std::string,XALLOC<std::string>> (),
const bool fit_range = false,
const allocator_type& alloc = allocator_type () );
......
......@@ -40,7 +40,7 @@ namespace gum {
template <template<typename> class ALLOC>
template <template<typename> class XALLOC>
DBTranslator4ContinuousVariable<ALLOC>::DBTranslator4ContinuousVariable (
std::vector<std::string,XALLOC<std::string>> missing_symbols,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool fit_range,
const typename
DBTranslator4ContinuousVariable<ALLOC>::allocator_type& alloc )
......@@ -78,12 +78,32 @@ namespace gum {
}
/// default constructor
template <template<typename> class ALLOC>
DBTranslator4ContinuousVariable<ALLOC>::DBTranslator4ContinuousVariable (
const bool fit_range,
const typename
DBTranslator4ContinuousVariable<ALLOC>::allocator_type& alloc )
: DBTranslator<ALLOC> ( DBTranslatedValueType::CONTINUOUS,
fit_range, 1, alloc )
, __variable ( "var", "" )
, __fit_range ( fit_range ) {
// if fit_range is true, we shall be able to update the ranges of
// the continuous variable. To indicate that we did not encountered any
// value yet in the database, we fix the lower bound of __variable to +max
if ( __fit_range )
__variable.setLowerBound ( std::numeric_limits<float>::infinity () );
GUM_CONSTRUCTOR( DBTranslator4ContinuousVariable );
}
/// default constructor with a range variable as translator
template <template<typename> class ALLOC>
template <typename GUM_SCALAR, template<typename> class XALLOC>
DBTranslator4ContinuousVariable<ALLOC>::DBTranslator4ContinuousVariable (
const ContinuousVariable<GUM_SCALAR>& var,
std::vector<std::string,XALLOC<std::string>> missing_symbols,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool fit_range,
const typename
DBTranslator4ContinuousVariable<ALLOC>::allocator_type& alloc )
......@@ -119,7 +139,29 @@ namespace gum {
GUM_CONSTRUCTOR( DBTranslator4ContinuousVariable );
}
/// default constructor with a range variable as translator
template <template<typename> class ALLOC>
template <typename GUM_SCALAR>
DBTranslator4ContinuousVariable<ALLOC>::DBTranslator4ContinuousVariable (
const ContinuousVariable<GUM_SCALAR>& var,
const bool fit_range,
const typename
DBTranslator4ContinuousVariable<ALLOC>::allocator_type& alloc )
: DBTranslator<ALLOC> ( DBTranslatedValueType::CONTINUOUS,
fit_range, 1, alloc )
, __variable ( var.name (), var.description () )
, __fit_range ( fit_range ) {
// get the bounds of the range variable
const float lower_bound = float ( var.lowerBound () );
const float upper_bound = float ( var.upperBound () );
__variable.setLowerBound ( lower_bound );
__variable.setUpperBound ( upper_bound );
GUM_CONSTRUCTOR( DBTranslator4ContinuousVariable );
}
/// copy constructor with a given allocator
template <template<typename> class ALLOC>
......
......@@ -143,11 +143,31 @@ namespace gum {
* @warning If the variable contained into the translator has a label
* equal to a missing value symbol, the label will be taken into
* account in the translation, not the missing value. */
template <typename GUM_SCALAR, template<typename> class XALLOC = ALLOC>
template <typename GUM_SCALAR, template<typename> class XALLOC>
DBTranslator4DiscretizedVariable (
const DiscretizedVariable<GUM_SCALAR>& var,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
const allocator_type& alloc = allocator_type () );
/** @brief default constructor with a discretized variable as translator
* but without missing symbols
*
* @param var a discretized variable which will be used for translations.
* The translator keeps a copy of this variable
* @param max_dico_entries the max number of entries that the dictionary
* can contain. During the construction, we check that the discretized
* variable passed in argument has fewer discretization intervals than
* the admissible dictionary size
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4DiscretizedVariable
* @warning If the variable contained into the translator has a label
* equal to a missing value symbol, the label will be taken into
* account in the translation, not the missing value. */
template <typename GUM_SCALAR>
DBTranslator4DiscretizedVariable (
const DiscretizedVariable<GUM_SCALAR>& var,
std::vector<std::string,XALLOC<std::string>> missing_symbols =
std::vector<std::string,XALLOC<std::string>> (),
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
const allocator_type& alloc = allocator_type () );
......
......@@ -42,7 +42,7 @@ namespace gum {
template <typename GUM_SCALAR, template<typename> class XALLOC>
DBTranslator4DiscretizedVariable<ALLOC>::DBTranslator4DiscretizedVariable (
const DiscretizedVariable<GUM_SCALAR>& var,
std::vector<std::string,XALLOC<std::string>> missing_symbols,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
std::size_t max_dico_entries,
const typename
DBTranslator4DiscretizedVariable<ALLOC>::allocator_type& alloc )
......@@ -96,6 +96,44 @@ namespace gum {
GUM_CONSTRUCTOR( DBTranslator4DiscretizedVariable );
}
/// default constructor with a discretized variable as translator
template <template<typename> class ALLOC>
template <typename GUM_SCALAR>
DBTranslator4DiscretizedVariable<ALLOC>::DBTranslator4DiscretizedVariable (
const DiscretizedVariable<GUM_SCALAR>& var,
std::size_t max_dico_entries,
const typename
DBTranslator4DiscretizedVariable<ALLOC>::allocator_type& alloc )
: DBTranslator<ALLOC> ( DBTranslatedValueType::DISCRETE,
false, max_dico_entries, alloc )
, __variable ( var.name (), var.description () ) {
// check that the variable has not too many entries
if ( var.domainSize () > max_dico_entries ) {
GUM_ERROR ( SizeError,
"the dictionary induced by the variable is too large" );
}
// copy the ticks of var into our internal variable
const auto& ticks = var.ticks ();
for ( const auto tick : ticks ) {
__variable.addTick ( tick );
}
// the the bounds of the discretized variable
const float lower_bound = ticks[0];
const float upper_bound = ticks.back ();
// add the content of the variable into the back dictionary
std::size_t size = 0;
for ( const auto& label : var.labels() ) {
this->_back_dico.insert ( size, label );
++size;
}
GUM_CONSTRUCTOR( DBTranslator4DiscretizedVariable );
}
/// copy constructor with a given allocator
......
......@@ -156,10 +156,26 @@ namespace gum {
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4LabelizedVariable
*/
template <template<typename> class XALLOC = ALLOC>
template <template<typename> class XALLOC>
DBTranslator4LabelizedVariable (
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
const allocator_type& alloc = allocator_type () );
/// default constructor without any initial variable nor missing symbols
/** When using this constructor, it is assumed implicitly that the
* dictionary contained into the translator is editable. So, when reading
* the database, if we observe a label that has not been encountered
* before, we add it into the dictionary of the translator (hence into
* the variable contained by the translator).
* @param max_dico_entries the max number of entries that the dictionary
* can contain. If we try to add new entries in the dictionary, this will
* be considered as an error and a SizeError exception will be raised
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4LabelizedVariable
*/
DBTranslator4LabelizedVariable (
std::vector<std::string,XALLOC<std::string>> missing_symbols =
std::vector<std::string,XALLOC<std::string>> (),
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
const allocator_type& alloc = allocator_type () );
......@@ -183,11 +199,36 @@ namespace gum {
* equal to a missing value symbol, the label will be taken into
* account in the translations, not the missing value.
*/
template <template<typename> class XALLOC = ALLOC>
template <template<typename> class XALLOC>
DBTranslator4LabelizedVariable (
const LabelizedVariable& var,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool editable_dictionary = false,
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
const allocator_type& alloc = allocator_type () );
/** @brief default constructor with a labelized variable as translator
* but without missing symbols
*
* @param var a labelized variable whose labels will be used for
* translations. The translator keeps a copy of this variable
* @param editable_dictionary the mode in which the translator will perform
* translations: when false (the default), the translation of a string
* that does not correspond to a label of var will raise a NotFound
* exception; when true, the translator will try to add the string as
* a new label into var (and therefore into the dictionary)
* @param max_dico_entries the max number of entries that the dictionary
* can contain. If we try to add new entries in the dictionary, this will
* be considered as an error and a SizeError exception will be raised
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4LabelizedVariable
* @warning If the variable contained into the translator has a label
* equal to a missing value symbol, the label will be taken into
* account in the translations, not the missing value.
*/
DBTranslator4LabelizedVariable (
const LabelizedVariable& var,
std::vector<std::string,XALLOC<std::string>> missing_symbols =
std::vector<std::string,XALLOC<std::string>> (),
const bool editable_dictionary = false,
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
......
......@@ -40,7 +40,7 @@ namespace gum {
template <template<typename> class ALLOC>
template <template<typename> class XALLOC>
DBTranslator4LabelizedVariable<ALLOC>::DBTranslator4LabelizedVariable (
std::vector<std::string,XALLOC<std::string>> missing_symbols,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
std::size_t max_dico_entries,
const typename
DBTranslator4LabelizedVariable<ALLOC>::allocator_type& alloc )
......@@ -52,12 +52,25 @@ namespace gum {
}
/// default constructor without missing symbols
template <template<typename> class ALLOC>
DBTranslator4LabelizedVariable<ALLOC>::DBTranslator4LabelizedVariable (
std::size_t max_dico_entries,
const typename
DBTranslator4LabelizedVariable<ALLOC>::allocator_type& alloc )
: DBTranslator<ALLOC> ( DBTranslatedValueType::DISCRETE,
true, max_dico_entries, alloc )
, __variable ( "var", "", 0 ) {
GUM_CONSTRUCTOR( DBTranslator4LabelizedVariable );
}
/// default constructor with a labelized variable as translator
template <template<typename> class ALLOC>
template <template<typename> class XALLOC>
INLINE DBTranslator4LabelizedVariable<ALLOC>::DBTranslator4LabelizedVariable (
DBTranslator4LabelizedVariable<ALLOC>::DBTranslator4LabelizedVariable (
const LabelizedVariable& var,
std::vector<std::string,XALLOC<std::string>> missing_symbols,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool editable_dictionary,
std::size_t max_dico_entries,
const typename
......@@ -88,6 +101,35 @@ namespace gum {
GUM_CONSTRUCTOR( DBTranslator4LabelizedVariable );
}
/// default constructor with a labelized variable as translator
template <template<typename> class ALLOC>
DBTranslator4LabelizedVariable<ALLOC>::DBTranslator4LabelizedVariable (
const LabelizedVariable& var,
const bool editable_dictionary,
std::size_t max_dico_entries,
const typename
DBTranslator4LabelizedVariable<ALLOC>::allocator_type& alloc )
: DBTranslator<ALLOC> ( DBTranslatedValueType::DISCRETE,
editable_dictionary, max_dico_entries, alloc )
, __variable ( var ) {
// check that the variable has not too many entries
if ( var.domainSize () > max_dico_entries ) {
GUM_ERROR ( SizeError,
"the dictionary induced by the variable is too large" );
}
// add the content of the variable into the back dictionary
std::size_t size = 0;
for ( const auto& label : var.labels() ) {
// insert the label into the back_dictionary
this->_back_dico.insert ( size, label );
++size;
}
GUM_CONSTRUCTOR( DBTranslator4LabelizedVariable );
}
/// copy constructor with a given allocator
......
......@@ -155,10 +155,26 @@ namespace gum {
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4RangeVariable
*/
template <template<typename> class XALLOC = ALLOC>
template <template<typename> class XALLOC>
DBTranslator4RangeVariable (
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
const allocator_type& alloc = allocator_type () );
/// default constructor without any initial variable nor missing symbols
/** When using this constructor, it is assumed implicitly that the
* dictionary contained into the translator is editable. So, when reading
* the database, if we observe a value that has not been encountered
* before, we update the range of the dictionary of the translator (hence
* that of the variable contained by the translator).
* @param max_dico_entries the max number of entries that the dictionary
* can contain. If we try to add new entries in the dictionary, this will
* be considered as an error and a SizeError exception will be raised
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4RangeVariable
*/
DBTranslator4RangeVariable (
std::vector<std::string,XALLOC<std::string>> missing_symbols =
std::vector<std::string,XALLOC<std::string>> (),
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
const allocator_type& alloc = allocator_type () );
......@@ -166,7 +182,7 @@ namespace gum {
/// default constructor with a discrete variable as translator
/** @param var a range variable which will be used for translations.
* The translator keeps a copy of this variable
* @param missing_symbols the set of symbols in the dataset
* @param missing_symbols the set of symbols in the dataset
* representing missing values
* @param editable_dictionary the mode in which the translator will perform
* translations: when false (the default), the translation of a string
......@@ -183,11 +199,37 @@ namespace gum {
* the range that is equal to a missing value symbol, the range value will
* be taken into account in the translations, not the missing value.
*/
template <template<typename> class XALLOC = ALLOC>
template <template<typename> class XALLOC>
DBTranslator4RangeVariable (
const RangeVariable& var,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool editable_dictionary = false,
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
const allocator_type& alloc = allocator_type () );
/** @brief default constructor with a discrete variable as translator
* but without missing symbols
*
* @param var a range variable which will be used for translations.
* The translator keeps a copy of this variable
* @param editable_dictionary the mode in which the translator will perform
* translations: when false (the default), the translation of a string
* that does not correspond to an integer within the range of var will
* raise a NotFound exception; when true, the translator will try to
* expand the domain of the RangeVariable so that the number represented in
* the string belongs to this domain ((and therefore to the dictionary)
* @param max_dico_entries the max number of entries that the dictionary
* can contain. If we try to add new entries in the dictionary, this will
* be considered as an error and a SizeError exception will be raised
* @param alloc The allocator used to allocate memory for all the
* fields of the DBTranslator4RangeVariable
* @warning If the variable contained into the translator has a value in
* the range that is equal to a missing value symbol, the range value will
* be taken into account in the translations, not the missing value.
*/
DBTranslator4RangeVariable (
const RangeVariable& var,
std::vector<std::string,XALLOC<std::string>> missing_symbols =
std::vector<std::string,XALLOC<std::string>> (),
const bool editable_dictionary = false,
std::size_t max_dico_entries =
std::numeric_limits<std::size_t>::max(),
......
......@@ -42,7 +42,7 @@ namespace gum {
template <template<typename> class ALLOC>
template <template<typename> class XALLOC>
DBTranslator4RangeVariable<ALLOC>::DBTranslator4RangeVariable (
std::vector<std::string,XALLOC<std::string>> missing_symbols,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
std::size_t max_dico_entries,
const typename
DBTranslator4RangeVariable<ALLOC>::allocator_type& alloc )
......@@ -67,6 +67,18 @@ namespace gum {
GUM_CONSTRUCTOR( DBTranslator4RangeVariable );
}
/// default constructor
template <template<typename> class ALLOC>
DBTranslator4RangeVariable<ALLOC>::DBTranslator4RangeVariable (
std::size_t max_dico_entries,
const typename DBTranslator4RangeVariable<ALLOC>::allocator_type& alloc )
: DBTranslator<ALLOC> ( DBTranslatedValueType::DISCRETE,
true, max_dico_entries, alloc )
, __variable ( "var", "", 1, 0 ) {
GUM_CONSTRUCTOR( DBTranslator4RangeVariable );
}
/// default constructor with a range variable as translator
......@@ -74,7 +86,7 @@ namespace gum {
template <template<typename> class XALLOC>
DBTranslator4RangeVariable<ALLOC>::DBTranslator4RangeVariable (
const RangeVariable& var,
std::vector<std::string,XALLOC<std::string>> missing_symbols,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool editable_dictionary,
std::size_t max_dico_entries,
const typename
......@@ -136,7 +148,42 @@ namespace gum {
GUM_CONSTRUCTOR( DBTranslator4RangeVariable );
}
/// default constructor with a range variable as translator
template <template<typename> class ALLOC>
DBTranslator4RangeVariable<ALLOC>::DBTranslator4RangeVariable (
const RangeVariable& var,
const bool editable_dictionary,
std::size_t max_dico_entries,
const typename
DBTranslator4RangeVariable<ALLOC>::allocator_type& alloc )
: DBTranslator<ALLOC> ( DBTranslatedValueType::DISCRETE,
editable_dictionary, max_dico_entries, alloc )
, __variable ( var ) {
// get the bounds of the range variable
const long lower_bound = var.minVal();
const long upper_bound = var.maxVal();
// check that the variable has not too many entries for the dictionary
if ( ( upper_bound >= lower_bound ) &&
( std::size_t ( upper_bound - lower_bound + 1 ) >
this->_max_dico_entries ) ) {
GUM_ERROR ( SizeError,
"the dictionary induced by the variable is too large" );
}
// add the content of the variable into the back dictionary
std::size_t size = 0;
for ( const auto& label : var.labels() ) {
// insert the label into the back_dictionary
this->_back_dico.insert ( size, label );
++size;
}
GUM_CONSTRUCTOR( DBTranslator4RangeVariable );
}
/// copy constructor with a given allocator
template <template<typename> class ALLOC>
......
......@@ -224,9 +224,25 @@ namespace gum {
std::size_t insertTranslator(
const Variable& var,
const std::size_t column,
std::vector<std::string,XALLOC<std::string>> missing_symbols =
std::vector<std::string,XALLOC<std::string>> () );
const std::vector<std::string,XALLOC<std::string>>& missing_symbols );
/// inserts a new translator for a given variable in the translator set
/** The first template parameter (GUM_SCALAR) is necessary only for
* inserting variables of true types DiscretizedVariable and
* ContinuousVariable, which depend on the GUM_SCALAR parameter type.
* However, usually, when you use this function, this is to add into
* the TranslatorSet the variables of a BayesNet<GUM_SCALAR>. As such, you
* can safely call insert all the variables of this Bayesian network
* using inertTranslator<GUM_SCALAR> ( bn.variable() ... ) instructions.
* @param var the variable that will be contained into the translator
* @param column the index of the column that this new translator should
* read in the database.
* @throw DuplicateElement is raised if there already exists a translator
* reading the column passed in argument.
*/
template <typename GUM_SCALAR = float>
std::size_t insertTranslator( const Variable& var,
const std::size_t column );
/** @brief erases either the kth translator or that parsing the kth
* column of the input database
......
......@@ -269,7 +269,7 @@ namespace gum {
std::size_t DBTranslatorSet<ALLOC>::insertTranslator(
const Variable& var,
const std::size_t column,
std::vector<std::string,XALLOC<std::string>> missing_symbols ) {
const std::vector<std::string,XALLOC<std::string>>& missing_symbols ) {
// create the translatator, depending on the type of the variable
switch ( var.varType() ) {
case VarType::Labelized:
......@@ -312,7 +312,18 @@ namespace gum {
GUM_ERROR ( NotImplementedYet, "not implemented yet" );
}
}
/// inserts a new translator for a given variable in the translator set
template <template<typename> class ALLOC>
template <typename GUM_SCALAR>
INLINE std::size_t DBTranslatorSet<ALLOC>::insertTranslator(
const Variable& var,
const std::size_t column ) {
const std::vector<std::string,ALLOC<std::string>> missing;
return insertTranslator<GUM_SCALAR,ALLOC>( var, column, missing );
}
/// erase the kth translator
template <template<typename> class ALLOC>
......
......@@ -52,7 +52,7 @@ namespace gum {
template <template<typename> class XALLOC>
INLINE DBTranslator<ALLOC>::DBTranslator (
DBTranslatedValueType val_type,
std::vector<std::string,XALLOC<std::string>> missing_symbols,
const std::vector<std::string,XALLOC<std::string>>& missing_symbols,
const bool dynamic_dictionary,
std::size_t max_dico_entries,
const typename DBTranslator<ALLOC>::allocator_type& alloc )
......@@ -73,6 +73,21 @@ namespace gum {
GUM_CONSTRUCTOR( DBTranslator );
}
/// default constructor
template <template<typename> class ALLOC>
INLINE DBTranslator<ALLOC>::DBTranslator (
DBTranslatedValueType val_type,
const bool dynamic_dictionary,
std::size_t max_dico_entries,
const typename DBTranslator<ALLOC>::allocator_type& alloc )
: DBTranslator<ALLOC>::allocator_type ( alloc )
, _is_dictionary_dynamic ( dynamic_dictionary )
, _max_dico_entries ( max_dico_entries )
, _val_type ( val_type ) {
GUM_CONSTRUCTOR( DBTranslator );
}
/// copy constructor with a given allocator
template <template<typename> class ALLOC>
......
......@@ -786,11 +786,11 @@ namespace gum {
/// @{
/// default constructor
template <template<typename> class VARALLOC = ALLOC,
template<typename> class MISSALLOC = ALLOC>
template <template<typename> class VARALLOC,
template<typename> class MISSALLOC>
IDatabaseTable(
const std::vector<std::string,VARALLOC<std::string>>& var_names,
const MissingValType<MISSALLOC>& missing_symbols,
const std::vector<std::string,VARALLOC<std::string>>& var_names,
const ALLOC<T_DATA>& alloc );
/// copy constructor
......