strus  0.17
vectorStorageTransactionInterface.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
9 #ifndef _STRUS_VECTOR_STORGE_TRANSACTION_INTERFACE_HPP_INCLUDED
10 #define _STRUS_VECTOR_STORGE_TRANSACTION_INTERFACE_HPP_INCLUDED
11 #include "strus/index.hpp"
12 #include "strus/wordVector.hpp"
13 #include <vector>
14 #include <string>
15 namespace strus {
16 
20 {
21 public:
24 
29  virtual void defineVector( const std::string& type, const std::string& feat, const WordVector& vec)=0;
30 
34  virtual void defineFeature( const std::string& type, const std::string& feat)=0;
35 
39  virtual void defineScalar( const std::string& name, double value)=0;
40 
42  virtual void clear()=0;
43 
46  virtual bool commit()=0;
47 
49  virtual void rollback()=0;
50 };
51 
52 }//namespace
53 #endif
54 
55 
Vector type used for word embedding vector calculations.
virtual void defineVector(const std::string &type, const std::string &feat, const WordVector &vec)=0
Define a vector for a feature for later retrieval.
Interface for building a repository of vectors with classifiers to map them to discrete features...
Definition: vectorStorageTransactionInterface.hpp:19
Numeric types used for local and global indices.
virtual void clear()=0
Clear all vectors,types and feature names in the storage.
virtual void defineScalar(const std::string &name, double value)=0
Define some scalar configuration parameter used in calculation (depending on implementation) ...
virtual void rollback()=0
Rollback of the transaction, no changes made.
virtual void defineFeature(const std::string &type, const std::string &feat)=0
Define a feature without vector.
std::vector< float > WordVector
Definition: wordVector.hpp:16
virtual bool commit()=0
Ensure the persistent storage of the features added with addFeature(const std::string&,const WordVector&) till now.
virtual ~VectorStorageTransactionInterface()
Destructor.
Definition: vectorStorageTransactionInterface.hpp:23