Skip to content

Commit

Permalink
remove funcgeninternal.h
Browse files Browse the repository at this point in the history
The container information added by `FuncGenInternal.h` has been made
redundant by the pluggable containers feature. Remove this legacy
difference.
  • Loading branch information
JakeHillion committed Dec 21, 2022
1 parent 9167275 commit abec0dc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 46 deletions.
19 changes: 0 additions & 19 deletions src/FuncGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

#include "ContainerInfo.h"

#ifndef OSS_ENABLE
#include "cea/object-introspection/internal/FuncGenInternal.h"
#endif

namespace {

const std::string typedValueFunc = R"(
Expand Down Expand Up @@ -137,9 +133,6 @@ const std::string typedValueFunc = R"(
}
)";

const std::map<ContainerTypeEnum, std::string> defaultTypeToDeclMap = {};

const std::map<ContainerTypeEnum, std::string> defaultTypeToFuncMap = {};
} // namespace

void FuncGen::DeclareGetSize(std::string& testCode, const std::string& type) {
Expand Down Expand Up @@ -461,18 +454,6 @@ void FuncGen::DeclareGetContainer(std::string& testCode) {
testCode.append(func);
}

// TODO: remove map initialisation once all container configs are removed from
// the code
FuncGen::FuncGen()
: typeToDeclMap(defaultTypeToDeclMap), typeToFuncMap(defaultTypeToFuncMap) {
#ifndef OSS_ENABLE
typeToDeclMap.insert(typeToDeclMapInternal.begin(),
typeToDeclMapInternal.end());
typeToFuncMap.insert(typeToFuncMapInternal.begin(),
typeToFuncMapInternal.end());
#endif
}

bool FuncGen::RegisterContainer(ContainerTypeEnum ctype, const fs::path& path) {
toml::table container;
try {
Expand Down
2 changes: 0 additions & 2 deletions src/FuncGen.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ namespace fs = std::filesystem;

class FuncGen {
public:
// TODO: remove me once all containers are in toml files
FuncGen();
bool RegisterContainer(ContainerTypeEnum, const fs::path& path);

void DeclareStoreData(std::string& testCode);
Expand Down
25 changes: 0 additions & 25 deletions src/OICodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
#include "OIParser.h"
#include "PaddingHunter.h"
#include "SymbolService.h"
#ifndef OSS_ENABLE
#include "cea/object-introspection/internal/FuncGenInternal.h"
#endif

namespace fs = std::filesystem;

Expand All @@ -46,13 +43,6 @@ static size_t g_level = 0;
#define VLOG(verboselevel) \
LOG_IF(INFO, VLOG_IS_ON(verboselevel)) << std::string(2 * g_level, ' ')

// typeName, numTemplateParams, ctype, header, namespaces...
// formatting disabled due to line length becoming a mess
// clang-format off
static const std::vector<ContainerInfo> defaultContainerInfoList = {
};
// clang-format on

std::unique_ptr<OICodeGen> OICodeGen::buildFromConfig(const Config &c) {
auto cg = std::unique_ptr<OICodeGen>(new OICodeGen(c));

Expand All @@ -66,22 +56,7 @@ std::unique_ptr<OICodeGen> OICodeGen::buildFromConfig(const Config &c) {
return cg;
}

// TODO: remove containerInfoList initialisation once all container configs are
// removed from the code
OICodeGen::OICodeGen(const Config &c) : config{c} {
#ifndef OSS_ENABLE
containerInfoList.reserve(containerInfoListInternal.size() +
defaultContainerInfoList.size());
for (const auto &el : containerInfoListInternal) {
containerInfoList.push_back(std::make_unique<ContainerInfo>(el));
}
#endif

containerInfoList.reserve(defaultContainerInfoList.size());
for (const auto &el : defaultContainerInfoList) {
containerInfoList.push_back(std::make_unique<ContainerInfo>(el));
}

// TODO: Should folly::Range just be added as a container?
auto typesToStub = std::array{
"SharedMutex",
Expand Down

0 comments on commit abec0dc

Please sign in to comment.