Skip to content

Commit

Permalink
Refactor some query classes to support new parser
Browse files Browse the repository at this point in the history
  • Loading branch information
jedelbo committed Nov 18, 2020
1 parent 0b1f8aa commit d69b2bc
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 218 deletions.
6 changes: 3 additions & 3 deletions .cproject → .cproject.sample
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<storageModule moduleId="cdtBuildSystem" version="4.0.0">

<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.111977426" name="Debug" optionalBuildProperties="" parent="org.eclipse.cdt.build.core.emptycfg">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.111977426" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.connection=unix:///var/run/docker.sock,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=" parent="org.eclipse.cdt.build.core.emptycfg">

<folderInfo id="cdt.managedbuild.toolchain.gnu.base.111977426.76548978" name="/" resourcePath="">

Expand Down Expand Up @@ -135,7 +135,7 @@

<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.457656542" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">

<option id="gnu.cpp.compiler.option.preprocessor.def.1922479465" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.1922479465" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">

<listOptionValue builtIn="false" value="__cplusplus=201703L"/>

Expand Down Expand Up @@ -223,7 +223,7 @@

<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1555249622" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">

<option id="gnu.cpp.compiler.option.preprocessor.def.1519821863" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.1519821863" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">

<listOptionValue builtIn="false" value="__cplusplus=201703L"/>

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Thumbs.db
/.vscode/settings.json
/.vscode/tasks.json

.cproject

# Ignore Eclipse settings
/.settings

Expand Down
6 changes: 0 additions & 6 deletions src/realm/parser/keypath_mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ std::size_t TableAndColHash::operator()(const std::pair<ConstTableRef, std::stri
}


KeyPathMapping::KeyPathMapping()
: m_allow_backlinks(true)
, m_mapping()
{
}

bool KeyPathMapping::add_mapping(ConstTableRef table, std::string name, std::string alias)
{
if (m_mapping.find({table, name}) == m_mapping.end()) {
Expand Down
4 changes: 2 additions & 2 deletions src/realm/parser/keypath_mapping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct TableAndColHash {
// It can also be used to allow querying named backlinks if bindings provide the mappings themselves.
class KeyPathMapping {
public:
KeyPathMapping();
KeyPathMapping() = default;
// returns true if added, false if duplicate key already exists
bool add_mapping(ConstTableRef table, std::string name, std::string alias);
void remove_mapping(ConstTableRef table, std::string name);
Expand All @@ -74,7 +74,7 @@ class KeyPathMapping {
ExpressionComparisonType type = ExpressionComparisonType::Any);

protected:
bool m_allow_backlinks;
bool m_allow_backlinks = true;
std::string m_backlink_class_prefix;
std::unordered_map<std::pair<ConstTableRef, std::string>, std::string, TableAndColHash> m_mapping;
};
Expand Down
Loading

0 comments on commit d69b2bc

Please sign in to comment.