Files
Sourcetrail/src/lib/data/graph/token_component/TokenComponentName.h
T
malte_langkabel e628241b02 data: database storage
* replaced storage by a new version that utilizes sqlite for persistence.
* added SqliteStorage to manage direct access to the database.
* added testsuit for sqlite.
* slimmed down the protected interface of the storage.
* changed tests in StorageTestSuit to avoid using protected methods of the storage.
* added functions to begin and commit a transaction to the storage.
* removed GraphFilterTestSuite.
* removed GraphFilterConductorTestSuite.
* added Node and Edge constructor that takes id as parameter
* added constructor for TokenComponentNameCached that accepts NameHierarchy as parameter
* added TokenLocation constructor that takes locationId as parameter.
* created respective construction functions in TokenLocatonLine, -File and -Collection.

fortune cookie message = Recognition will come from unexpected sources.
2015-08-25 18:07:02 +02:00

65 lines
1.5 KiB
C++

#ifndef TOKEN_COMPONENT_NAME_H
#define TOKEN_COMPONENT_NAME_H
#include <string>
#include "data/graph/token_component/TokenComponent.h"
#include "data/name/NameHierarchy.h"
#include "data/search/SearchNode.h"
class TokenComponentName
: public TokenComponent
{
public:
TokenComponentName();
virtual ~TokenComponentName();
std::shared_ptr<TokenComponentName> copyComponentName() const;
virtual std::string getName() const = 0;
virtual std::string getFullName() const = 0;
virtual const SearchNode* getSearchNode() const = 0;
};
class TokenComponentNameReferenced
: public TokenComponentName
{
public:
TokenComponentNameReferenced(const SearchNode* searchNode);
virtual ~TokenComponentNameReferenced();
virtual std::shared_ptr<TokenComponent> copy() const;
virtual std::string getName() const;
virtual std::string getFullName() const;
virtual const SearchNode* getSearchNode() const;
private:
const SearchNode* m_searchNode;
};
class TokenComponentNameCached
: public TokenComponentName
{
public:
TokenComponentNameCached(const std::vector<std::string>& nameHierarchy);
TokenComponentNameCached(const NameHierarchy& nameHierarchy);
virtual ~TokenComponentNameCached();
virtual std::shared_ptr<TokenComponent> copy() const;
virtual std::string getName() const;
virtual std::string getFullName() const;
virtual const SearchNode* getSearchNode() const;
private:
std::vector<std::string> m_nameHierarchy; // TODO: use const NameHierarchy here
};
#endif // TOKEN_COMPONENT_NAME_H