Skip to content

Commit

Permalink
Renamed namespace Veles -> veles
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarkovtsev committed Nov 1, 2013
1 parent 1031056 commit 75f1836
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions libVeles/inc/veles/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#pragma GCC visibility push(default)
#endif

namespace Veles {
namespace veles {

/// @brief Enables logging with different levels and domains for inherited
/// classes.
Expand Down Expand Up @@ -167,14 +167,14 @@ class DefaultLogger : public Logger {
static std::string StripVelesNamespace(std::string&& symbol) noexcept {
std::string res(std::forward<std::string>(symbol));
size_t pos;
while ((pos = res.find("Veles::")) != std::string::npos) {
while ((pos = res.find("veles::")) != std::string::npos) {
res = res.erase(pos, 7);
}
return res;
}
};

} // namespace Veles
} // namespace veles

#if __GNUC__ >= 4
#pragma GCC visibility pop
Expand Down
4 changes: 2 additions & 2 deletions libVeles/inc/veles/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#pragma GCC visibility push(default)
#endif

namespace Veles {
namespace veles {

/** @brief VELES neural network unit */
class Unit {
Expand Down Expand Up @@ -48,7 +48,7 @@ class Unit {
virtual size_t OutputCount() const noexcept = 0;
};

} // namespace Veles
} // namespace veles

#if __GNUC__ >= 4
#pragma GCC visibility pop
Expand Down
4 changes: 2 additions & 2 deletions libVeles/inc/veles/unit_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#pragma GCC visibility push(default)
#endif

namespace Veles {
namespace veles {

/// @brief Unit factory class.
/// @details Use it the following way:
Expand Down Expand Up @@ -92,7 +92,7 @@ class RegisterUnit : DefaultLogger<RegisterUnit<T>, Logger::COLOR_LIGHTBLUE> {
/// @param T The type of your Unit-derived class.
#define REGISTER_UNIT(T) RegisterUnit<T> T##RegistryInstance;

} // namespace Veles
} // namespace veles

#if __GNUC__ >= 4
#pragma GCC visibility pop
Expand Down
4 changes: 2 additions & 2 deletions libVeles/inc/veles/workflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#pragma GCC visibility push(default)
#endif

namespace Veles {
namespace veles {

/** @brief VELES workflow */
class Workflow : protected DefaultLogger<Workflow, Logger::COLOR_ORANGE> {
Expand Down Expand Up @@ -95,7 +95,7 @@ class Workflow : protected DefaultLogger<Workflow, Logger::COLOR_ORANGE> {
std::vector<std::shared_ptr<Unit>> units_;
};

} // namespace Veles
} // namespace veles

#if __GNUC__ >= 4
#pragma GCC visibility pop
Expand Down
4 changes: 2 additions & 2 deletions libVeles/inc/veles/workflow_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Node;

}

namespace Veles {
namespace veles {

class WorkflowExtractionFailedException : public std::exception {
public:
Expand Down Expand Up @@ -248,7 +248,7 @@ class WorkflowLoader : protected DefaultLogger<WorkflowLoader,
std::string file_with_workflow_;
};

} // namespace Veles
} // namespace veles

#if __GNUC__ >= 4
#pragma GCC visibility pop
Expand Down
2 changes: 1 addition & 1 deletion libVeles/src/logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <cxxabi.h>
#include <string.h>

namespace Veles {
namespace veles {

// The following defines must not be converted to static const members of Logger
// due to the undefined order in which static constructors are invoked.
Expand Down
6 changes: 3 additions & 3 deletions libVeles/src/unit_factory.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! @file unit_factory.cc
* @brief Implements Veles::UnitFactory class.
* @brief Implements veles::UnitFactory class.
* @author markhor
* @version 1.0
*
Expand All @@ -14,7 +14,7 @@
#include <cstdio>
#include <string>

namespace Veles {
namespace veles {

UnitFactory::UnitFactory()
: Logger("UnitFactory", GetColorByIndex(Logger::COLOR_LIGHTBLUE)) {
Expand Down Expand Up @@ -44,4 +44,4 @@ void UnitFactory::PrintRegisteredUnits() const {
}
}

} // namespace Veles
} // namespace veles
4 changes: 2 additions & 2 deletions libVeles/src/workflow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <stdexcept>
#include "inc/veles/workflow.h"

namespace Veles {
namespace veles {

void Workflow::Add(const std::shared_ptr<Unit>& unit) {
units_.push_back(unit);
Expand Down Expand Up @@ -52,5 +52,5 @@ float* Workflow::mallocf(size_t length) {
static_cast<float*>(ptr) : nullptr;
}

} // namespace Veles
} // namespace veles

32 changes: 16 additions & 16 deletions libVeles/src/workflow_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ using std::vector;
using std::shared_ptr;
using std::ifstream;
using std::unique_ptr;
using Veles::WorkflowLoader;
using Veles::UnitDescription;
using Veles::PropertiesTable;
using Veles::WorkflowDescription;
using Veles::WorkflowExtractionError;
using veles::WorkflowLoader;
using veles::UnitDescription;
using veles::PropertiesTable;
using veles::WorkflowDescription;
using veles::WorkflowExtractionError;

/// Default name of decompressed yaml file.
const char* WorkflowLoader::kWorkflowDecompressedFile =
Expand Down Expand Up @@ -69,9 +69,9 @@ void WorkflowLoader::GetWorkflow(const string& yaml_filename) {
DBG("Node type %d", workflow.at(0).Type());
CreateWorkflow(workflow.at(0));
} else {
ERR("Veles::WorkflowLoader::GetWorkflow: can't extract workflow");
ERR("veles::WorkflowLoader::GetWorkflow: can't extract workflow");
throw std::runtime_error(
"Veles::WorkflowLoader::GetWorkflow: can't extract workflow");
"veles::WorkflowLoader::GetWorkflow: can't extract workflow");
}
}

Expand All @@ -97,9 +97,9 @@ void WorkflowLoader::CreateWorkflow(const YAML::Node& doc) {
WorkflowLoader::workflow_desc_.Units.push_back(unit);
} else {
// It can't be neither Scalar nor Map!!!
ERR("Veles::WorkflowLoader::CreateWorkflow: bad YAML::Node");
ERR("veles::WorkflowLoader::CreateWorkflow: bad YAML::Node");
throw std::runtime_error(
"Veles::WorkflowLoader::CreateWorkflow: bad YAML::Node");
"veles::WorkflowLoader::CreateWorkflow: bad YAML::Node");
}
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@ void WorkflowLoader::GetUnit(const YAML::Node& doc, UnitDescription* unit) {
GetProperties(it.second)});
} else {
throw std::runtime_error(
"Veles::WorkflowLoader::GetUnit: bad YAML::Node");
"veles::WorkflowLoader::GetUnit: bad YAML::Node");
}
}
}
Expand All @@ -156,9 +156,9 @@ shared_ptr<void> WorkflowLoader::GetProperties(const YAML::Node& node) {
}
return tempVectorSequence;
}
ERR("Veles::WorkflowLoader::GetProperties: bad YAML::Node");
ERR("veles::WorkflowLoader::GetProperties: bad YAML::Node");
throw std::runtime_error
("Veles::WorkflowLoader::GetProperties: bad YAML::Node");
("veles::WorkflowLoader::GetProperties: bad YAML::Node");
}

template <typename T>
Expand All @@ -180,7 +180,7 @@ std::shared_ptr<float> WorkflowLoader::GetArrayFromFile(const string& file,
std::ios::ate);
if (!fr.is_open()) {
throw std::runtime_error
("Veles::WorkflowLoader::GetArrayFromFile: Can't open file with array");
("veles::WorkflowLoader::GetArrayFromFile: Can't open file with array");
}
// Calculate size of float array to read from file
fr.seekg (0, fr.end);
Expand All @@ -200,7 +200,7 @@ std::shared_ptr<float> WorkflowLoader::GetArrayFromFile(const string& file,

void WorkflowLoader::InitializeWorkflow() {
for (auto& it : workflow_desc_.Units) {
auto unit_constructor = Veles::UnitFactory::Instance()[it.Name];
auto unit_constructor = veles::UnitFactory::Instance()[it.Name];
if (unit_constructor) {
auto unit = unit_constructor();
for (auto& it_unit : it.Properties) {
Expand All @@ -226,7 +226,7 @@ void WorkflowLoader::InitializeWorkflow() {
}
}

Veles::Workflow WorkflowLoader::GetWorkflow() {
veles::Workflow WorkflowLoader::GetWorkflow() {
if (workflow_.Size() == 0U) {
InitializeWorkflow();
}
Expand Down Expand Up @@ -312,7 +312,7 @@ void WorkflowLoader::ExtractArchive(const string& filename,
}
}
} catch(const std::exception& e) {
auto error = string("(Veles::WorkflowLoader::ExtractArchive:\nCan't open "
auto error = string("(veles::WorkflowLoader::ExtractArchive:\nCan't open "
"archive: ") + e.what() + ")";
ERR("%s", error.c_str());
throw std::runtime_error(error);
Expand Down
8 changes: 4 additions & 4 deletions libVeles/tests/unit_factory.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! @file unit_registry.cc
* @brief Tests for Veles::UnitRegistry and friends.
* @brief Tests for veles::UnitRegistry and friends.
* @author markhor
* @version 1.0
*
Expand All @@ -15,7 +15,7 @@
#include <gtest/gtest.h>
#include "inc/veles/unit_factory.h"

namespace Veles {
namespace veles {

class DummyUnit : public Unit {
public:
Expand All @@ -40,11 +40,11 @@ class DummyUnit : public Unit {
};
REGISTER_UNIT(DummyUnit);

} // namespace Veles
} // namespace veles


TEST(UnitRegistry, DummyCreate) {
auto dummy = Veles::UnitFactory::Instance()["Dummy"]();
auto dummy = veles::UnitFactory::Instance()["Dummy"]();
ASSERT_STREQ("Dummy", dummy->Name().c_str());
}

Expand Down
2 changes: 1 addition & 1 deletion libVeles/tests/unit_mock.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ float* mallocf(size_t length) {

/** @brief Dummy unit which passes doubled looped inputs to outputs.
*/
class UnitMock : public Veles::Unit {
class UnitMock : public veles::Unit {
public:
static const std::string kName;

Expand Down
4 changes: 2 additions & 2 deletions libVeles/tests/workflow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
const size_t WorkflowTest::kCount = 3;

TEST(Workflow, Construct) {
Veles::Workflow workflow;
veles::Workflow workflow;
size_t kExpectedCount = 0;
EXPECT_EQ(kExpectedCount, workflow.Size());
}

TEST(Workflow, Add) {
Veles::Workflow workflow;
veles::Workflow workflow;
const size_t kCount = 100;
const size_t kInputs = 3;
const size_t kOutputs = 4;
Expand Down
2 changes: 1 addition & 1 deletion libVeles/tests/workflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class WorkflowTest : public ::testing::TestWithParam<
*/
void GetExpected(std::vector<size_t>* out);

Veles::Workflow workflow_;
veles::Workflow workflow_;
};

#endif // TESTS_WORKFLOW_H_
4 changes: 2 additions & 2 deletions libVeles/tests/workflow_loader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using std::string;
using std::static_pointer_cast;

namespace Veles {
namespace veles {

class WorkflowLoaderTest
: public ::testing::Test,
Expand Down Expand Up @@ -352,6 +352,6 @@ TEST_F(WorkflowLoaderTest, MainTest2) {
MainTest2();
}

} // namespace Veles
} // namespace veles

#include "tests/google/src/gtest_main.cc"

0 comments on commit 75f1836

Please sign in to comment.