diff --git a/README.md b/README.md index ca594fdc..6b1de129 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Documentation is available here: The library exhibits the following structure: ```txt -├── Types +├── Type │ ├── Integer │ ├── Real │ ├── String @@ -102,7 +102,7 @@ The library exhibits the following structure: │ ├── Unique │ ├── Shared │ └── Weak -├── Containers +├── Container │ ├── Array │ ├── List │ ├── Map @@ -138,10 +138,11 @@ The library exhibits the following structure: │ ├── Undefined │ ├── Wrong │ └── To Be Implemented -└── Utilities - ├── Iterators +└── Utility + ├── Iterator └── Version ``` +

@@ -202,8 +203,8 @@ Or to run them manually: ## Dependencies -| Name | Version | License | Link | -| ----------- | -------- | ------------ | ---------------------------------------------------------------------- | +| Name | Version | License | Link | +| ----------- | ---------- | ------------ | ------------------------------------------------------------------- | | Pybind11 | `2.10.1` | BSD-3-Clause | [github.com/pybind/pybind11](https://github.com/pybind/pybind11) | | RapidJSON | `master` | MIT | [rapidjson.org](http://rapidjson.org) | | yaml-cpp | `0.7.0` | MIT | [github.com/jbeder/yaml-cpp](https://github.com/jbeder/yaml-cpp) | diff --git a/bindings/python/docs/Reference.ipynb b/bindings/python/docs/Reference.ipynb index 90a13446..f1c7bb99 100644 --- a/bindings/python/docs/Reference.ipynb +++ b/bindings/python/docs/Reference.ipynb @@ -50,7 +50,7 @@ "metadata": {}, "outputs": [], "source": [ - "types = core.types" + "type = core.type" ] }, { @@ -66,7 +66,7 @@ "metadata": {}, "outputs": [], "source": [ - "Integer = types.Integer" + "Integer = type.Integer" ] }, { @@ -82,7 +82,7 @@ "metadata": {}, "outputs": [], "source": [ - "Real = types.Real" + "Real = type.Real" ] }, { @@ -98,7 +98,7 @@ "metadata": {}, "outputs": [], "source": [ - "String = types.String" + "String = type.String" ] }, { @@ -114,7 +114,7 @@ "metadata": {}, "outputs": [], "source": [ - "containers = core.containers" + "container = core.container" ] }, { @@ -130,11 +130,11 @@ "metadata": {}, "outputs": [], "source": [ - "[i for i in containers.get_int_array()]\n", - "[i for i in containers.get_double_array()]\n", - "[i for i in containers.get_integer_array()]\n", - "[i for i in containers.get_real_array()]\n", - "[i for i in containers.get_string_array()];" + "[i for i in container.get_int_array()]\n", + "[i for i in container.get_double_array()]\n", + "[i for i in container.get_integer_array()]\n", + "[i for i in container.get_real_array()]\n", + "[i for i in container.get_string_array()];" ] }, { @@ -143,8 +143,8 @@ "metadata": {}, "outputs": [], "source": [ - "containers.set_int_array([1, 2, 3])\n", - "containers.set_int_array((1, 2, 3))" + "container.set_int_array([1, 2, 3])\n", + "container.set_int_array((1, 2, 3))" ] }, { @@ -153,8 +153,8 @@ "metadata": {}, "outputs": [], "source": [ - "containers.set_double_array([1.0, 2.0, 3.0])\n", - "containers.set_double_array((1.0, 2.0, 3.0))" + "container.set_double_array([1.0, 2.0, 3.0])\n", + "container.set_double_array((1.0, 2.0, 3.0))" ] }, { @@ -163,8 +163,8 @@ "metadata": {}, "outputs": [], "source": [ - "containers.set_integer_array([1, 2, 3])\n", - "containers.set_integer_array((1, 2, 3))" + "container.set_integer_array([1, 2, 3])\n", + "container.set_integer_array((1, 2, 3))" ] }, { @@ -173,8 +173,8 @@ "metadata": {}, "outputs": [], "source": [ - "containers.set_real_array([1.0, 2.0, 3.0])\n", - "containers.set_real_array((1.0, 2.0, 3.0))" + "container.set_real_array([1.0, 2.0, 3.0])\n", + "container.set_real_array((1.0, 2.0, 3.0))" ] }, { @@ -183,8 +183,8 @@ "metadata": {}, "outputs": [], "source": [ - "containers.set_string_array([\"abc\", \"def\", \"ghi\"])\n", - "containers.set_string_array((\"abc\", \"def\", \"ghi\"))" + "container.set_string_array([\"abc\", \"def\", \"ghi\"])\n", + "container.set_string_array((\"abc\", \"def\", \"ghi\"))" ] }, { @@ -216,4 +216,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/bindings/python/src/OpenSpaceToolkitCorePy.cxx b/bindings/python/src/OpenSpaceToolkitCorePy.cxx index e8b1e24b..c71b1d07 100644 --- a/bindings/python/src/OpenSpaceToolkitCorePy.cxx +++ b/bindings/python/src/OpenSpaceToolkitCorePy.cxx @@ -1,17 +1,17 @@ /// Apache License 2.0 -#include +#include #include #include -#include +#include #include -#include +#include PYBIND11_MODULE(OpenSpaceToolkitCorePy, m) { // Add optional docstring for package OpenSpaceToolkitCorePy - m.doc() = "Fundamental types, containers and utilities for OpenSpaceToolkit."; + m.doc() = "Fundamental types, container and utility for OpenSpaceToolkit."; // Add __path__ attribute to python package m.attr("__path__") = "ostk.core"; @@ -27,7 +27,7 @@ PYBIND11_MODULE(OpenSpaceToolkitCorePy, m) #endif // Add python submodules to OpenSpaceToolkitCorePy - OpenSpaceToolkitCorePy_Types(m); - OpenSpaceToolkitCorePy_Containers(m); + OpenSpaceToolkitCorePy_Type(m); + OpenSpaceToolkitCorePy_Container(m); OpenSpaceToolkitCorePy_FileSystem(m); } diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Container.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Container.cpp new file mode 100644 index 00000000..0ac4c0fa --- /dev/null +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Container.cpp @@ -0,0 +1,19 @@ +/// Apache License 2.0 + +#include +#include +#include + +inline void OpenSpaceToolkitCorePy_Container(pybind11::module& aModule) +{ + // Create "container" python submodule + auto container = aModule.def_submodule("container"); + + // Add __path__ attribute for "container" submodule + container.attr("__path__") = "ostk.core.container"; + + // Add objects to python "container" submodules + OpenSpaceToolkitCorePy_Container_Array(container); + OpenSpaceToolkitCorePy_Container_Object(container); + OpenSpaceToolkitCorePy_Container_Dictionary(container); +} diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Containers/Array.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Container/Array.cpp similarity index 75% rename from bindings/python/src/OpenSpaceToolkitCorePy/Containers/Array.cpp rename to bindings/python/src/OpenSpaceToolkitCorePy/Container/Array.cpp index 1dd1e773..10b8b0d2 100644 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Containers/Array.cpp +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Container/Array.cpp @@ -1,16 +1,16 @@ /// Apache License 2.0 -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -using ostk::core::ctnr::Array; -using ostk::core::types::Integer; -using ostk::core::types::Real; -using ostk::core::types::String; +using ostk::core::container::Array; +using ostk::core::type::Integer; +using ostk::core::type::Real; +using ostk::core::type::String; /// @brief Set and Get Array functions /// @@ -73,15 +73,15 @@ Array getStringArray() return vector; } -inline void OpenSpaceToolkitCorePy_Containers_Array(pybind11::module& aModule) +inline void OpenSpaceToolkitCorePy_Container_Array(pybind11::module& aModule) { using namespace pybind11; - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; - using ostk::core::ctnr::Array; + using ostk::core::container::Array; aModule.def("set_int_array", overload_cast&>(&setIntArray)); aModule.def("set_double_array", overload_cast&>(&setDoubleArray)); diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Containers/ArrayCasting.hpp b/bindings/python/src/OpenSpaceToolkitCorePy/Container/ArrayCasting.hpp similarity index 78% rename from bindings/python/src/OpenSpaceToolkitCorePy/Containers/ArrayCasting.hpp rename to bindings/python/src/OpenSpaceToolkitCorePy/Container/ArrayCasting.hpp index 9da9e980..8aad96fe 100644 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Containers/ArrayCasting.hpp +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Container/ArrayCasting.hpp @@ -3,14 +3,14 @@ #include #include -#include +#include namespace pybind11 { namespace detail { -using ostk::core::ctnr::Array; +using ostk::core::container::Array; template struct type_caster> : list_caster, T> diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Containers/Dictionary.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Container/Dictionary.cpp similarity index 88% rename from bindings/python/src/OpenSpaceToolkitCorePy/Containers/Dictionary.cpp rename to bindings/python/src/OpenSpaceToolkitCorePy/Container/Dictionary.cpp index 3cb9403d..b2a81b02 100644 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Containers/Dictionary.cpp +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Container/Dictionary.cpp @@ -2,18 +2,18 @@ #include -#include -#include -#include +#include +#include +#include -using ostk::core::ctnr::Object; -using ostk::core::ctnr::Dictionary; +using ostk::core::container::Object; +using ostk::core::container::Dictionary; Object objectFromPythonHandle(const pybind11::handle& anObject) { using namespace pybind11; - using ostk::core::ctnr::Array; + using ostk::core::container::Array; if (isinstance(anObject)) { @@ -62,13 +62,13 @@ Object objectFromPythonHandle(const pybind11::handle& anObject) throw ostk::core::error::RuntimeError("Object type is wrong."); } -inline void OpenSpaceToolkitCorePy_Containers_Dictionary(pybind11::module& aModule) +inline void OpenSpaceToolkitCorePy_Container_Dictionary(pybind11::module& aModule) { using namespace pybind11; - using ostk::core::types::String; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::type::String; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; class_ dictionary_class(aModule, "Dictionary"); diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Containers/Object.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Container/Object.cpp similarity index 85% rename from bindings/python/src/OpenSpaceToolkitCorePy/Containers/Object.cpp rename to bindings/python/src/OpenSpaceToolkitCorePy/Container/Object.cpp index f08230cf..3ba02b05 100644 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Containers/Object.cpp +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Container/Object.cpp @@ -1,19 +1,19 @@ /// Apache License 2.0 -#include -#include -#include -#include +#include +#include +#include +#include -inline void OpenSpaceToolkitCorePy_Containers_Object(pybind11::module& aModule) +inline void OpenSpaceToolkitCorePy_Container_Object(pybind11::module& aModule) { using namespace pybind11; - using ostk::core::types::Index; - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; - using ostk::core::ctnr::Object; + using ostk::core::type::Index; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; + using ostk::core::container::Object; class_ object_class(aModule, "Object"); diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Containers.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Containers.cpp deleted file mode 100644 index 555390a3..00000000 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Containers.cpp +++ /dev/null @@ -1,19 +0,0 @@ -/// Apache License 2.0 - -#include -#include -#include - -inline void OpenSpaceToolkitCorePy_Containers(pybind11::module& aModule) -{ - // Create "containers" python submodule - auto containers = aModule.def_submodule("containers"); - - // Add __path__ attribute for "containers" submodule - containers.attr("__path__") = "ostk.core.containers"; - - // Add objects to python "containers" submodules - OpenSpaceToolkitCorePy_Containers_Array(containers); - OpenSpaceToolkitCorePy_Containers_Object(containers); - OpenSpaceToolkitCorePy_Containers_Dictionary(containers); -} diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Type.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Type.cpp new file mode 100644 index 00000000..4995e4db --- /dev/null +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Type.cpp @@ -0,0 +1,21 @@ +/// Apache License 2.0 + +#include +#include +#include +#include + +inline void OpenSpaceToolkitCorePy_Type(pybind11::module& aModule) +{ + // Create "type" python submodule + auto type = aModule.def_submodule("type"); + + // Add __path__ attribute for "type" submodule + type.attr("__path__") = "ostk.core.type"; + + // Add custom type to python "type" submodule + OpenSpaceToolkitCorePy_Type_Sign(type); + OpenSpaceToolkitCorePy_Type_Integer(type); + OpenSpaceToolkitCorePy_Type_Real(type); + OpenSpaceToolkitCorePy_Type_String(type); +} diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Types/Integer.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Type/Integer.cpp similarity index 87% rename from bindings/python/src/OpenSpaceToolkitCorePy/Types/Integer.cpp rename to bindings/python/src/OpenSpaceToolkitCorePy/Type/Integer.cpp index 2e428b41..da26e1fd 100644 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Types/Integer.cpp +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Type/Integer.cpp @@ -1,14 +1,14 @@ /// Apache License 2.0 -#include +#include -inline void OpenSpaceToolkitCorePy_Types_Integer(pybind11::module& aModule) +inline void OpenSpaceToolkitCorePy_Type_Integer(pybind11::module& aModule) { using namespace pybind11; - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; class_(aModule, "Integer") @@ -18,7 +18,7 @@ inline void OpenSpaceToolkitCorePy_Types_Integer(pybind11::module& aModule) // Define __int__ method for direct conversion (previously .def(int_(self))) .def( "__int__", - +[](const ostk::core::types::Integer& anInteger) -> int + +[](const ostk::core::type::Integer& anInteger) -> int { return static_cast(anInteger); } @@ -57,14 +57,14 @@ inline void OpenSpaceToolkitCorePy_Types_Integer(pybind11::module& aModule) .def( "__str__", - +[](const ostk::core::types::Integer& anInteger) -> std::string + +[](const ostk::core::type::Integer& anInteger) -> std::string { return anInteger.toString(); } ) .def( "__repr__", - +[](const ostk::core::types::Integer& anInteger) -> std::string + +[](const ostk::core::type::Integer& anInteger) -> std::string { return anInteger.toString(); } diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Types/Real.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Type/Real.cpp similarity index 86% rename from bindings/python/src/OpenSpaceToolkitCorePy/Types/Real.cpp rename to bindings/python/src/OpenSpaceToolkitCorePy/Type/Real.cpp index 28e70d50..8c61f2bc 100644 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Types/Real.cpp +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Type/Real.cpp @@ -1,14 +1,14 @@ /// Apache License 2.0 -#include +#include -inline void OpenSpaceToolkitCorePy_Types_Real(pybind11::module& aModule) +inline void OpenSpaceToolkitCorePy_Type_Real(pybind11::module& aModule) { using namespace pybind11; - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; class_(aModule, "Real") @@ -18,7 +18,7 @@ inline void OpenSpaceToolkitCorePy_Types_Real(pybind11::module& aModule) // Define __float__ method for direct conversion .def( "__float__", - +[](const ostk::core::types::Real& aReal) -> double + +[](const ostk::core::type::Real& aReal) -> double { return static_cast(aReal); } @@ -57,14 +57,14 @@ inline void OpenSpaceToolkitCorePy_Types_Real(pybind11::module& aModule) .def( "__str__", - +[](const ostk::core::types::Real& aReal) -> std::string + +[](const ostk::core::type::Real& aReal) -> std::string { return aReal.toString(); } ) .def( "__repr__", - +[](const ostk::core::types::Real& aReal) -> std::string + +[](const ostk::core::type::Real& aReal) -> std::string { return aReal.toString(); } diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Types/Sign.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Type/Sign.cpp similarity index 65% rename from bindings/python/src/OpenSpaceToolkitCorePy/Types/Sign.cpp rename to bindings/python/src/OpenSpaceToolkitCorePy/Type/Sign.cpp index eddc2eda..5a78518d 100644 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Types/Sign.cpp +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Type/Sign.cpp @@ -1,12 +1,12 @@ /// Apache License 2.0 -#include +#include -inline void OpenSpaceToolkitCorePy_Types_Sign(pybind11::module& aModule) +inline void OpenSpaceToolkitCorePy_Type_Sign(pybind11::module& aModule) { using namespace pybind11; - using ostk::core::types::Sign; + using ostk::core::type::Sign; enum_(aModule, "Sign") .value("Undefined", Sign::Undefined) diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Types/String.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Type/String.cpp similarity index 80% rename from bindings/python/src/OpenSpaceToolkitCorePy/Types/String.cpp rename to bindings/python/src/OpenSpaceToolkitCorePy/Type/String.cpp index ad21dd48..2b26bad8 100644 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Types/String.cpp +++ b/bindings/python/src/OpenSpaceToolkitCorePy/Type/String.cpp @@ -1,14 +1,14 @@ /// Apache License 2.0 -#include -#include +#include +#include -inline void OpenSpaceToolkitCorePy_Types_String(pybind11::module& aModule) +inline void OpenSpaceToolkitCorePy_Type_String(pybind11::module& aModule) { using namespace pybind11; - using ostk::core::types::Size; - using ostk::core::types::String; + using ostk::core::type::Size; + using ostk::core::type::String; class_(aModule, "String") @@ -29,14 +29,14 @@ inline void OpenSpaceToolkitCorePy_Types_String(pybind11::module& aModule) .def( "__str__", - +[](const ostk::core::types::String& aString) -> str + +[](const ostk::core::type::String& aString) -> str { return aString; } ) .def( "__repr__", - +[](const ostk::core::types::String& aString) -> std::string + +[](const ostk::core::type::String& aString) -> std::string { return aString; } diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Types.cpp b/bindings/python/src/OpenSpaceToolkitCorePy/Types.cpp deleted file mode 100644 index f9a7983a..00000000 --- a/bindings/python/src/OpenSpaceToolkitCorePy/Types.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/// Apache License 2.0 - -#include -#include -#include -#include - -inline void OpenSpaceToolkitCorePy_Types(pybind11::module& aModule) -{ - // Create "types" python submodule - auto types = aModule.def_submodule("types"); - - // Add __path__ attribute for "types" submodule - types.attr("__path__") = "ostk.core.types"; - - // Add custom types to python "types" submodule - OpenSpaceToolkitCorePy_Types_Sign(types); - OpenSpaceToolkitCorePy_Types_Integer(types); - OpenSpaceToolkitCorePy_Types_Real(types); - OpenSpaceToolkitCorePy_Types_String(types); -} diff --git a/bindings/python/src/OpenSpaceToolkitCorePy/Utilities/ShiftToString.hpp b/bindings/python/src/OpenSpaceToolkitCorePy/Utility/ShiftToString.hpp similarity index 100% rename from bindings/python/src/OpenSpaceToolkitCorePy/Utilities/ShiftToString.hpp rename to bindings/python/src/OpenSpaceToolkitCorePy/Utility/ShiftToString.hpp diff --git a/bindings/python/test/containers/test_array.py b/bindings/python/test/containers/test_array.py index 7fb07528..b4b43a7f 100644 --- a/bindings/python/test/containers/test_array.py +++ b/bindings/python/test/containers/test_array.py @@ -2,7 +2,7 @@ import pytest -from ostk.core.containers import * +from ostk.core.container import * def test_array_set(): diff --git a/bindings/python/test/containers/test_dictionary.py b/bindings/python/test/containers/test_dictionary.py index 109a9a0f..166c9608 100644 --- a/bindings/python/test/containers/test_dictionary.py +++ b/bindings/python/test/containers/test_dictionary.py @@ -2,8 +2,8 @@ import pytest -from ostk.core.containers import Dictionary -from ostk.core.containers import Object +from ostk.core.container import Dictionary +from ostk.core.container import Object @pytest.fixture diff --git a/bindings/python/test/containers/test_object.py b/bindings/python/test/containers/test_object.py index 0d98458c..1ca94679 100644 --- a/bindings/python/test/containers/test_object.py +++ b/bindings/python/test/containers/test_object.py @@ -4,8 +4,8 @@ from tempfile import NamedTemporaryFile -from ostk.core.containers import Object -from ostk.core.containers import Dictionary +from ostk.core.container import Object +from ostk.core.container import Dictionary from ostk.core.filesystem import Path from ostk.core.filesystem import File diff --git a/bindings/python/test/filesystem/test_directory.py b/bindings/python/test/filesystem/test_directory.py index 7c6ec85f..8076c935 100644 --- a/bindings/python/test/filesystem/test_directory.py +++ b/bindings/python/test/filesystem/test_directory.py @@ -5,7 +5,7 @@ import pytest from ostk.core.filesystem import Path, Directory -from ostk.core.types import String +from ostk.core.type import String def test_directory_constructors(): diff --git a/bindings/python/test/filesystem/test_file.py b/bindings/python/test/filesystem/test_file.py index a0f6b91d..6ef36a5b 100644 --- a/bindings/python/test/filesystem/test_file.py +++ b/bindings/python/test/filesystem/test_file.py @@ -2,7 +2,7 @@ import pytest -from ostk.core.types import String +from ostk.core.type import String from ostk.core.filesystem import Directory, Path, PermissionSet, File diff --git a/bindings/python/test/filesystem/test_path.py b/bindings/python/test/filesystem/test_path.py index 001d80da..1737e297 100644 --- a/bindings/python/test/filesystem/test_path.py +++ b/bindings/python/test/filesystem/test_path.py @@ -3,7 +3,7 @@ import pytest from ostk.core.filesystem import Path -from ostk.core.types import String +from ostk.core.type import String def test_path_parse(): diff --git a/bindings/python/test/types_/test_integer.py b/bindings/python/test/types_/test_integer.py index 0ed1d120..0a3641d0 100644 --- a/bindings/python/test/types_/test_integer.py +++ b/bindings/python/test/types_/test_integer.py @@ -2,7 +2,7 @@ import pytest -from ostk.core.types import Integer, Sign +from ostk.core.type import Integer, Sign def test_integer_constructors(): diff --git a/bindings/python/test/types_/test_real.py b/bindings/python/test/types_/test_real.py index f3cef165..c6338925 100644 --- a/bindings/python/test/types_/test_real.py +++ b/bindings/python/test/types_/test_real.py @@ -4,7 +4,7 @@ import math -from ostk.core.types import Real, Sign +from ostk.core.type import Real, Sign def test_real_constructors(): diff --git a/bindings/python/test/types_/test_sign.py b/bindings/python/test/types_/test_sign.py index 5867c38a..12513f26 100644 --- a/bindings/python/test/types_/test_sign.py +++ b/bindings/python/test/types_/test_sign.py @@ -2,7 +2,7 @@ import pytest -from ostk.core.types import Sign +from ostk.core.type import Sign def test_sign_enum(): diff --git a/bindings/python/test/types_/test_string.py b/bindings/python/test/types_/test_string.py index 87117127..86669e30 100644 --- a/bindings/python/test/types_/test_string.py +++ b/bindings/python/test/types_/test_string.py @@ -2,7 +2,7 @@ import pytest -from ostk.core.types import String +from ostk.core.type import String def test_string_constructors(): diff --git a/bindings/python/tools/python/setup.cfg.in b/bindings/python/tools/python/setup.cfg.in index 278626ae..551ab915 100644 --- a/bindings/python/tools/python/setup.cfg.in +++ b/bindings/python/tools/python/setup.cfg.in @@ -9,7 +9,7 @@ name = open-space-toolkit-core version = ${PROJECT_VERSION_STRING} author = Open Space Collective author_email = contact@open-space-collective.org -description = Fundamental types, containers and utilities. +description = Fundamental types, container and utility. keywords = open-space-collective, open-space-toolkit core long_description = file: README.md long_description_content_type = text/markdown diff --git a/docker/development/Dockerfile b/docker/development/Dockerfile index 2bf7e7f9..7e143023 100644 --- a/docker/development/Dockerfile +++ b/docker/development/Dockerfile @@ -85,7 +85,6 @@ LABEL VERSION="${VERSION}" FROM root-user as non-root-user # Install dev utilities - RUN apt-get update \ && apt-get install -y zsh sudo \ && rm -rf /var/lib/apt/lists/* diff --git a/include/OpenSpaceToolkit/Core/Containers/Array.hpp b/include/OpenSpaceToolkit/Core/Container/Array.hpp similarity index 95% rename from include/OpenSpaceToolkit/Core/Containers/Array.hpp rename to include/OpenSpaceToolkit/Core/Container/Array.hpp index 9d11a37f..42121865 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Array.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Array.hpp @@ -1,31 +1,31 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Array__ -#define __OpenSpaceToolkit_Core_Containers_Array__ +#ifndef __OpenSpaceToolkit_Core_Container_Array__ +#define __OpenSpaceToolkit_Core_Container_Array__ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace ostk { namespace core { -namespace ctnr +namespace container { -using ostk::core::types::Index; -using ostk::core::types::Size; -using ostk::core::types::String; +using ostk::core::type::Index; +using ostk::core::type::Size; +using ostk::core::type::String; /// @brief Array container /// -/// Sequence containers representing arrays that can change in size. +/// Sequence container representing arrays that can change in size. /// Arrays use contiguous storage locations for their elements. template @@ -245,7 +245,7 @@ class Array : public std::vector /// /// @return String representation of array - types::String toString() const; + type::String toString() const; /// @brief Get array of pointers to element based on condition /// @@ -424,10 +424,10 @@ class Array : public std::vector static Array Empty(); }; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk -#include +#include #endif diff --git a/include/OpenSpaceToolkit/Core/Containers/Dictionary.hpp b/include/OpenSpaceToolkit/Core/Container/Dictionary.hpp similarity index 92% rename from include/OpenSpaceToolkit/Core/Containers/Dictionary.hpp rename to include/OpenSpaceToolkit/Core/Container/Dictionary.hpp index 52bb01e2..34b4d940 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Dictionary.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Dictionary.hpp @@ -1,28 +1,28 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Dictionary__ -#define __OpenSpaceToolkit_Core_Containers_Dictionary__ +#ifndef __OpenSpaceToolkit_Core_Container_Dictionary__ +#define __OpenSpaceToolkit_Core_Container_Dictionary__ -#include -#include -#include +#include +#include +#include #include -#include -#include +#include +#include namespace ostk { namespace core { -namespace ctnr +namespace container { namespace filesystem = ostk::core::filesystem; -using ostk::core::types::Size; -using ostk::core::types::String; -using ostk::core::ctnr::OrderedMap; -using ostk::core::ctnr::Object; +using ostk::core::type::Size; +using ostk::core::type::String; +using ostk::core::container::OrderedMap; +using ostk::core::container::Object; /// @brief Key-value pairs container /// @@ -33,8 +33,8 @@ using ostk::core::ctnr::Object; class Dictionary { public: - typedef types::String Key; - typedef ctnr::List Path; + typedef type::String Key; + typedef container::List Path; typedef Object Value; class Iterator @@ -299,7 +299,7 @@ class Dictionary /// @param [in] (optional) aFormat Serialization format /// @return Dictionary - static Dictionary Parse(const types::String& aString, const Object::Format& aFormat = Object::Format::Undefined); + static Dictionary Parse(const type::String& aString, const Object::Format& aFormat = Object::Format::Undefined); private: OrderedMap map_; @@ -307,7 +307,7 @@ class Dictionary Dictionary(); }; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Containers/Graph.hpp b/include/OpenSpaceToolkit/Core/Container/Graph.hpp similarity index 83% rename from include/OpenSpaceToolkit/Core/Containers/Graph.hpp rename to include/OpenSpaceToolkit/Core/Container/Graph.hpp index 11f9182d..b0df300a 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Graph.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Graph.hpp @@ -1,13 +1,13 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Graph__ -#define __OpenSpaceToolkit_Core_Containers_Graph__ +#ifndef __OpenSpaceToolkit_Core_Container_Graph__ +#define __OpenSpaceToolkit_Core_Container_Graph__ namespace ostk { namespace core { -namespace ctnr +namespace container { /// @brief Structure consisting of a finite set of vertices, together with a set of pairs of these @@ -38,7 +38,7 @@ class Graph // [TBI] }; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Containers/Iterators/Zip.hpp b/include/OpenSpaceToolkit/Core/Container/Iterator/Zip.hpp similarity index 91% rename from include/OpenSpaceToolkit/Core/Containers/Iterators/Zip.hpp rename to include/OpenSpaceToolkit/Core/Container/Iterator/Zip.hpp index c8f7c28b..320b22c1 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Iterators/Zip.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Iterator/Zip.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Iterators_Zip__ -#define __OpenSpaceToolkit_Core_Containers_Iterators_Zip__ +#ifndef __OpenSpaceToolkit_Core_Container_Iterator_Zip__ +#define __OpenSpaceToolkit_Core_Container_Iterator_Zip__ #include #include @@ -11,9 +11,9 @@ namespace ostk { namespace core { -namespace ctnr +namespace container { -namespace iterators +namespace iterator { /// @brief Zip iterator @@ -105,8 +105,8 @@ auto Zip(T&&... seqs) return ZipIterator {seqs...}; } -} // namespace iterators -} // namespace ctnr +} // namespace iterator +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Containers/List.hpp b/include/OpenSpaceToolkit/Core/Container/List.hpp similarity index 60% rename from include/OpenSpaceToolkit/Core/Containers/List.hpp rename to include/OpenSpaceToolkit/Core/Container/List.hpp index 9410fd3b..f3371e31 100644 --- a/include/OpenSpaceToolkit/Core/Containers/List.hpp +++ b/include/OpenSpaceToolkit/Core/Container/List.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_List__ -#define __OpenSpaceToolkit_Core_Containers_List__ +#ifndef __OpenSpaceToolkit_Core_Container_List__ +#define __OpenSpaceToolkit_Core_Container_List__ #include @@ -9,7 +9,7 @@ namespace ostk { namespace core { -namespace ctnr +namespace container { /// @brief List container @@ -17,7 +17,7 @@ namespace ctnr template using List = std::list; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Containers/Map.hpp b/include/OpenSpaceToolkit/Core/Container/Map.hpp similarity index 70% rename from include/OpenSpaceToolkit/Core/Containers/Map.hpp rename to include/OpenSpaceToolkit/Core/Container/Map.hpp index f9709e87..23027391 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Map.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Map.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Map__ -#define __OpenSpaceToolkit_Core_Containers_Map__ +#ifndef __OpenSpaceToolkit_Core_Container_Map__ +#define __OpenSpaceToolkit_Core_Container_Map__ #include @@ -9,7 +9,7 @@ namespace ostk { namespace core { -namespace ctnr +namespace container { /// @brief Map container @@ -17,7 +17,7 @@ namespace ctnr template , class Allocator = std::allocator>> using Map = std::map; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Containers/Object.hpp b/include/OpenSpaceToolkit/Core/Container/Object.hpp similarity index 59% rename from include/OpenSpaceToolkit/Core/Containers/Object.hpp rename to include/OpenSpaceToolkit/Core/Container/Object.hpp index a0a4c99d..ef6d08a8 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Object.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Object.hpp @@ -1,30 +1,30 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Object__ -#define __OpenSpaceToolkit_Core_Containers_Object__ +#ifndef __OpenSpaceToolkit_Core_Container_Object__ +#define __OpenSpaceToolkit_Core_Container_Object__ #include #include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace ostk { namespace core { -namespace ctnr +namespace container { namespace filesystem = ostk::core::filesystem; -using ostk::core::types::Unique; +using ostk::core::type::Unique; class Dictionary; @@ -73,7 +73,7 @@ class Object /// /// @param [in] aList An initializer list - Object(std::initializer_list> aList); + Object(std::initializer_list> aList); /// @brief Copy constructor /// @@ -118,11 +118,11 @@ class Object bool operator!=(const Object& anObject) const; - const Object& operator[](const types::String& aKey) const; - const Object& operator[](const types::Index& anIndex) const; + const Object& operator[](const type::String& aKey) const; + const Object& operator[](const type::Index& anIndex) const; - Object& operator[](const types::String& aKey); - Object& operator[](const types::Index& anIndex); + Object& operator[](const type::String& aKey); + Object& operator[](const type::Index& anIndex); friend std::ostream& operator<<(std::ostream& anOutputStream, const Object& anObject); @@ -139,52 +139,52 @@ class Object bool isArray() const; const bool& accessBoolean() const; - const types::Integer& accessInteger() const; - const types::Real& accessReal() const; - const types::String& accessString() const; - const ctnr::Dictionary& accessDictionary() const; - const ctnr::Array& accessArray() const; + const type::Integer& accessInteger() const; + const type::Real& accessReal() const; + const type::String& accessString() const; + const container::Dictionary& accessDictionary() const; + const container::Array& accessArray() const; Object::Type getType() const; bool getBoolean() const; - types::Integer getInteger() const; - types::Real getReal() const; - types::String getString() const; - ctnr::Dictionary getDictionary() const; - ctnr::Array getArray() const; + type::Integer getInteger() const; + type::Real getReal() const; + type::String getString() const; + container::Dictionary getDictionary() const; + container::Array getArray() const; - types::String toString(const Object::Format& aFormat = Object::Format::Undefined) const; - types::String getJsonString() const; + type::String toString(const Object::Format& aFormat = Object::Format::Undefined) const; + type::String getJsonString() const; bool& accessBoolean(); - types::Integer& accessInteger(); - types::Real& accessReal(); - types::String& accessString(); - ctnr::Dictionary& accessDictionary(); - ctnr::Array& accessArray(); + type::Integer& accessInteger(); + type::Real& accessReal(); + type::String& accessString(); + container::Dictionary& accessDictionary(); + container::Array& accessArray(); static Object Undefined(); static Object Boolean(const bool& aBoolean); - static Object Integer(const types::Integer& anInteger = types::Integer::Undefined()); + static Object Integer(const type::Integer& anInteger = type::Integer::Undefined()); - static Object Real(const types::Real& aReal = types::Real::Undefined()); + static Object Real(const type::Real& aReal = type::Real::Undefined()); - static Object String(const types::String& aString = types::String::Empty()); + static Object String(const type::String& aString = type::String::Empty()); - static Object Dictionary(const ctnr::Dictionary& aDictionary); + static Object Dictionary(const container::Dictionary& aDictionary); - static Object Array(const ctnr::Array& anArray = ctnr::Array::Empty()); + static Object Array(const container::Array& anArray = container::Array::Empty()); - static Object Parse(const types::String& aString, const Object::Format& aFormat = Object::Format::Undefined); + static Object Parse(const type::String& aString, const Object::Format& aFormat = Object::Format::Undefined); static Object Load(const filesystem::File& aFile, const Object::Format& aFormat = Object::Format::Undefined); - static types::String StringFromType(const Object::Type& aType); + static type::String StringFromType(const Object::Type& aType); - static Object::Type TypeFromString(const types::String& aString); + static Object::Type TypeFromString(const type::String& aString); private: class Impl; @@ -193,12 +193,12 @@ class Object Object(const Unique& anObjectImpl); - static Object ParseJson(const types::String& aString); + static Object ParseJson(const type::String& aString); - static Object ParseYaml(const types::String& aString); + static Object ParseYaml(const type::String& aString); }; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Containers/OrderedMap.hpp b/include/OpenSpaceToolkit/Core/Container/OrderedMap.hpp similarity index 90% rename from include/OpenSpaceToolkit/Core/Containers/OrderedMap.hpp rename to include/OpenSpaceToolkit/Core/Container/OrderedMap.hpp index 1583dbe7..01b6f9e9 100644 --- a/include/OpenSpaceToolkit/Core/Containers/OrderedMap.hpp +++ b/include/OpenSpaceToolkit/Core/Container/OrderedMap.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_OrderedMap__ -#define __OpenSpaceToolkit_Core_Containers_OrderedMap__ +#ifndef __OpenSpaceToolkit_Core_Container_OrderedMap__ +#define __OpenSpaceToolkit_Core_Container_OrderedMap__ #include #include @@ -18,7 +18,7 @@ namespace ostk { namespace core { -namespace ctnr +namespace container { /// @brief Ordered map container @@ -57,7 +57,7 @@ using OrderedMap = tsl::ordered_map +#include + +#include +#include +#include +#include + +namespace ostk +{ +namespace core +{ +namespace container +{ + +using ostk::core::type::Index; +using ostk::core::type::Size; +using ostk::core::type::String; + +/// @brief Pair container + +template +using Pair = std::pair; + +} // namespace container +} // namespace core +} // namespace ostk + +#endif diff --git a/include/OpenSpaceToolkit/Core/Containers/Queue.hpp b/include/OpenSpaceToolkit/Core/Container/Queue.hpp similarity index 79% rename from include/OpenSpaceToolkit/Core/Containers/Queue.hpp rename to include/OpenSpaceToolkit/Core/Container/Queue.hpp index a6ded7ff..bd5e8e92 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Queue.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Queue.hpp @@ -1,13 +1,13 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Graph__ -#define __OpenSpaceToolkit_Core_Containers_Graph__ +#ifndef __OpenSpaceToolkit_Core_Container_Graph__ +#define __OpenSpaceToolkit_Core_Container_Graph__ namespace ostk { namespace core { -namespace ctnr +namespace container { /// @brief First-in, first-out (FIFO) container @@ -35,7 +35,7 @@ class Queue // [TBI] }; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Containers/Stack.hpp b/include/OpenSpaceToolkit/Core/Container/Stack.hpp similarity index 79% rename from include/OpenSpaceToolkit/Core/Containers/Stack.hpp rename to include/OpenSpaceToolkit/Core/Container/Stack.hpp index d5bbe4dc..9c7e69c1 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Stack.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Stack.hpp @@ -1,13 +1,13 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Stack__ -#define __OpenSpaceToolkit_Core_Containers_Stack__ +#ifndef __OpenSpaceToolkit_Core_Container_Stack__ +#define __OpenSpaceToolkit_Core_Container_Stack__ namespace ostk { namespace core { -namespace ctnr +namespace container { /// @brief First-in, last-out (FILO) container @@ -35,7 +35,7 @@ class Stack // [TBI] }; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Containers/Table.hpp b/include/OpenSpaceToolkit/Core/Container/Table.hpp similarity index 92% rename from include/OpenSpaceToolkit/Core/Containers/Table.hpp rename to include/OpenSpaceToolkit/Core/Container/Table.hpp index a46721f1..6d97bf87 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Table.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Table.hpp @@ -1,29 +1,29 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Table__ -#define __OpenSpaceToolkit_Core_Containers_Table__ +#ifndef __OpenSpaceToolkit_Core_Container_Table__ +#define __OpenSpaceToolkit_Core_Container_Table__ -#include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include namespace ostk { namespace core { -namespace ctnr +namespace container { -using ostk::core::types::Index; -using ostk::core::types::Size; -using ostk::core::types::String; -using ostk::core::ctnr::Array; -using ostk::core::ctnr::table::Row; -using ostk::core::ctnr::table::Cell; +using ostk::core::type::Index; +using ostk::core::type::Size; +using ostk::core::type::String; +using ostk::core::container::Array; +using ostk::core::container::table::Row; +using ostk::core::container::table::Cell; using ostk::core::filesystem::File; /// @brief Table container @@ -263,7 +263,7 @@ class Table static Table LoadCsv(const File& aFile, bool hasHeader = true); }; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Container/Table/Cell.hpp b/include/OpenSpaceToolkit/Core/Container/Table/Cell.hpp new file mode 100644 index 00000000..0d0a915b --- /dev/null +++ b/include/OpenSpaceToolkit/Core/Container/Table/Cell.hpp @@ -0,0 +1,26 @@ +/// Apache License 2.0 + +#ifndef __OpenSpaceToolkit_Core_Container_Table_Cell__ +#define __OpenSpaceToolkit_Core_Container_Table_Cell__ + +#include + +namespace ostk +{ +namespace core +{ +namespace container +{ +namespace table +{ + +/// @brief Cell of table + +using Cell = container::Object; + +} // namespace table +} // namespace container +} // namespace core +} // namespace ostk + +#endif diff --git a/include/OpenSpaceToolkit/Core/Containers/Table/Row.hpp b/include/OpenSpaceToolkit/Core/Container/Table/Row.hpp similarity index 65% rename from include/OpenSpaceToolkit/Core/Containers/Table/Row.hpp rename to include/OpenSpaceToolkit/Core/Container/Table/Row.hpp index aefaab5b..87dca927 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Table/Row.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Table/Row.hpp @@ -1,18 +1,18 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Table_Row__ -#define __OpenSpaceToolkit_Core_Containers_Table_Row__ +#ifndef __OpenSpaceToolkit_Core_Container_Table_Row__ +#define __OpenSpaceToolkit_Core_Container_Table_Row__ -#include -#include -#include -#include +#include +#include +#include +#include namespace ostk { namespace core { -namespace ctnr +namespace container { class Table; @@ -20,11 +20,11 @@ class Table; namespace table { -using ostk::core::types::Index; -using ostk::core::types::Size; -using ostk::core::types::String; -using ostk::core::ctnr::Array; -using ostk::core::ctnr::table::Cell; +using ostk::core::type::Index; +using ostk::core::type::Size; +using ostk::core::type::String; +using ostk::core::container::Array; +using ostk::core::container::table::Cell; /// @brief Row of table container @@ -69,7 +69,7 @@ class Row }; } // namespace table -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Containers/Tree.hpp b/include/OpenSpaceToolkit/Core/Container/Tree.hpp similarity index 89% rename from include/OpenSpaceToolkit/Core/Containers/Tree.hpp rename to include/OpenSpaceToolkit/Core/Container/Tree.hpp index 7dabbdb4..5c44b50c 100644 --- a/include/OpenSpaceToolkit/Core/Containers/Tree.hpp +++ b/include/OpenSpaceToolkit/Core/Container/Tree.hpp @@ -1,13 +1,13 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Containers_Tree__ -#define __OpenSpaceToolkit_Core_Containers_Tree__ +#ifndef __OpenSpaceToolkit_Core_Container_Tree__ +#define __OpenSpaceToolkit_Core_Container_Tree__ namespace ostk { namespace core { -namespace ctnr +namespace container { /// @brief Undirected graph in which any two vertices are connected by exactly one path @@ -43,7 +43,7 @@ class Tree // [TBI] }; -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Container/Triple.hpp b/include/OpenSpaceToolkit/Core/Container/Triple.hpp new file mode 100644 index 00000000..bd2ab3a6 --- /dev/null +++ b/include/OpenSpaceToolkit/Core/Container/Triple.hpp @@ -0,0 +1,44 @@ +/// Apache License 2.0 + +#ifndef __OpenSpaceToolkit_Core_Container_Triple__ +#define __OpenSpaceToolkit_Core_Container_Triple__ + +#include +#include + +#include +#include +#include +#include + +namespace ostk +{ +namespace core +{ +namespace container +{ + +using ostk::core::type::Index; +using ostk::core::type::Size; +using ostk::core::type::String; + +/// @brief Triple container + +template +struct Triple +{ + T first; + U second; + V third; +}; + +template +Triple make_triple(const T& aFirstElement, const U& aSecondElement, const V& aThirdElement); + +} // namespace container +} // namespace core +} // namespace ostk + +#include + +#endif diff --git a/include/OpenSpaceToolkit/Core/Container/Tuple.hpp b/include/OpenSpaceToolkit/Core/Container/Tuple.hpp new file mode 100644 index 00000000..275134d1 --- /dev/null +++ b/include/OpenSpaceToolkit/Core/Container/Tuple.hpp @@ -0,0 +1,39 @@ +/// Apache License 2.0 + +#ifndef __OpenSpaceToolkit_Core_Container_Tuple__ +#define __OpenSpaceToolkit_Core_Container_Tuple__ + +#include +#include + +#include +#include +#include + +namespace ostk +{ +namespace core +{ +namespace container +{ + +using ostk::core::type::Index; +using ostk::core::type::Size; +using ostk::core::type::String; + +/// @brief Tuple container + +template +using Tuple = std::tuple; + +template +auto Unpack(Args&... args) +{ + return std::tuple(args...); +} + +} // namespace container +} // namespace core +} // namespace ostk + +#endif diff --git a/include/OpenSpaceToolkit/Core/Containers/Pair.hpp b/include/OpenSpaceToolkit/Core/Containers/Pair.hpp deleted file mode 100644 index 8e0ae384..00000000 --- a/include/OpenSpaceToolkit/Core/Containers/Pair.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/// Apache License 2.0 - -#ifndef __OpenSpaceToolkit_Core_Containers_Pair__ -#define __OpenSpaceToolkit_Core_Containers_Pair__ - -#include -#include - -#include -#include -#include -#include - -namespace ostk -{ -namespace core -{ -namespace ctnr -{ - -using ostk::core::types::Index; -using ostk::core::types::Size; -using ostk::core::types::String; - -/// @brief Pair container - -template -using Pair = std::pair; - -} // namespace ctnr -} // namespace core -} // namespace ostk - -#endif diff --git a/include/OpenSpaceToolkit/Core/Containers/Table/Cell.hpp b/include/OpenSpaceToolkit/Core/Containers/Table/Cell.hpp deleted file mode 100644 index 0936670c..00000000 --- a/include/OpenSpaceToolkit/Core/Containers/Table/Cell.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/// Apache License 2.0 - -#ifndef __OpenSpaceToolkit_Core_Containers_Table_Cell__ -#define __OpenSpaceToolkit_Core_Containers_Table_Cell__ - -#include - -namespace ostk -{ -namespace core -{ -namespace ctnr -{ -namespace table -{ - -/// @brief Cell of table - -using Cell = ctnr::Object; - -} // namespace table -} // namespace ctnr -} // namespace core -} // namespace ostk - -#endif diff --git a/include/OpenSpaceToolkit/Core/Containers/Triple.hpp b/include/OpenSpaceToolkit/Core/Containers/Triple.hpp deleted file mode 100644 index 3502e185..00000000 --- a/include/OpenSpaceToolkit/Core/Containers/Triple.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/// Apache License 2.0 - -#ifndef __OpenSpaceToolkit_Core_Containers_Triple__ -#define __OpenSpaceToolkit_Core_Containers_Triple__ - -#include -#include - -#include -#include -#include -#include - -namespace ostk -{ -namespace core -{ -namespace ctnr -{ - -using ostk::core::types::Index; -using ostk::core::types::Size; -using ostk::core::types::String; - -/// @brief Triple container - -template -struct Triple -{ - T first; - U second; - V third; -}; - -template -Triple make_triple(const T& aFirstElement, const U& aSecondElement, const V& aThirdElement); - -} // namespace ctnr -} // namespace core -} // namespace ostk - -#include - -#endif diff --git a/include/OpenSpaceToolkit/Core/Containers/Tuple.hpp b/include/OpenSpaceToolkit/Core/Containers/Tuple.hpp deleted file mode 100644 index 7666d50a..00000000 --- a/include/OpenSpaceToolkit/Core/Containers/Tuple.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/// Apache License 2.0 - -#ifndef __OpenSpaceToolkit_Core_Containers_Tuple__ -#define __OpenSpaceToolkit_Core_Containers_Tuple__ - -#include -#include - -#include -#include -#include - -namespace ostk -{ -namespace core -{ -namespace ctnr -{ - -using ostk::core::types::Index; -using ostk::core::types::Size; -using ostk::core::types::String; - -/// @brief Tuple container - -template -using Tuple = std::tuple; - -template -auto Unpack(Args&... args) -{ - return std::tuple(args...); -} - -} // namespace ctnr -} // namespace core -} // namespace ostk - -#endif diff --git a/include/OpenSpaceToolkit/Core/Error/Exception.hpp b/include/OpenSpaceToolkit/Core/Error/Exception.hpp index 4e427fd8..bcfb4166 100644 --- a/include/OpenSpaceToolkit/Core/Error/Exception.hpp +++ b/include/OpenSpaceToolkit/Core/Error/Exception.hpp @@ -5,7 +5,7 @@ #include -#include +#include namespace ostk { @@ -14,7 +14,7 @@ namespace core namespace error { -using ostk::core::types::String; +using ostk::core::type::String; /// @brief Exception class diff --git a/include/OpenSpaceToolkit/Core/Error/Runtime/ToBeImplemented.hpp b/include/OpenSpaceToolkit/Core/Error/Runtime/ToBeImplemented.hpp index e46bdefe..541f7070 100644 --- a/include/OpenSpaceToolkit/Core/Error/Runtime/ToBeImplemented.hpp +++ b/include/OpenSpaceToolkit/Core/Error/Runtime/ToBeImplemented.hpp @@ -4,7 +4,7 @@ #define __OpenSpaceToolkit_Core_Error_Runtime_ToBeImplemented__ #include -#include +#include namespace ostk { @@ -15,7 +15,7 @@ namespace error namespace runtime { -using ostk::core::types::String; +using ostk::core::type::String; /// @brief To be implemented error class diff --git a/include/OpenSpaceToolkit/Core/Error/Runtime/Undefined.hpp b/include/OpenSpaceToolkit/Core/Error/Runtime/Undefined.hpp index e663d4fb..c4a9559a 100644 --- a/include/OpenSpaceToolkit/Core/Error/Runtime/Undefined.hpp +++ b/include/OpenSpaceToolkit/Core/Error/Runtime/Undefined.hpp @@ -4,7 +4,7 @@ #define __OpenSpaceToolkit_Core_Error_Runtime_Undefined__ #include -#include +#include namespace ostk { @@ -15,7 +15,7 @@ namespace error namespace runtime { -using ostk::core::types::String; +using ostk::core::type::String; /// @brief Undefined variable error class diff --git a/include/OpenSpaceToolkit/Core/Error/Runtime/Wrong.hpp b/include/OpenSpaceToolkit/Core/Error/Runtime/Wrong.hpp index bb6aaee6..e828503a 100644 --- a/include/OpenSpaceToolkit/Core/Error/Runtime/Wrong.hpp +++ b/include/OpenSpaceToolkit/Core/Error/Runtime/Wrong.hpp @@ -4,7 +4,7 @@ #define __OpenSpaceToolkit_Core_Error_Runtime_Wrong__ #include -#include +#include namespace ostk { @@ -15,7 +15,7 @@ namespace error namespace runtime { -using ostk::core::types::String; +using ostk::core::type::String; /// @brief Wrong variable error class diff --git a/include/OpenSpaceToolkit/Core/Error/RuntimeError.hpp b/include/OpenSpaceToolkit/Core/Error/RuntimeError.hpp index b403c9d3..b50deb67 100644 --- a/include/OpenSpaceToolkit/Core/Error/RuntimeError.hpp +++ b/include/OpenSpaceToolkit/Core/Error/RuntimeError.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include namespace ostk { @@ -17,7 +17,7 @@ namespace core namespace error { -using ostk::core::types::String; +using ostk::core::type::String; /// @brief Runtime error class diff --git a/include/OpenSpaceToolkit/Core/FileSystem/Directory.hpp b/include/OpenSpaceToolkit/Core/FileSystem/Directory.hpp index 7bb359c4..7f088b05 100644 --- a/include/OpenSpaceToolkit/Core/FileSystem/Directory.hpp +++ b/include/OpenSpaceToolkit/Core/FileSystem/Directory.hpp @@ -3,11 +3,11 @@ #ifndef __OpenSpaceToolkit_Core_FileSystem_Directory__ #define __OpenSpaceToolkit_Core_FileSystem_Directory__ -#include +#include #include #include #include -#include +#include namespace ostk { @@ -16,9 +16,9 @@ namespace core namespace filesystem { -namespace ctnr = ostk::core::ctnr; +namespace container = ostk::core::container; -using ostk::core::types::String; +using ostk::core::type::String; /// @brief Cataloging structure which contains references to other computer files, and possibly /// other directories @@ -194,7 +194,7 @@ class Directory /// /// @return Array of files in directory - ctnr::Array getFiles() const; + container::Array getFiles() const; /// @brief Get directories in directory /// @@ -207,7 +207,7 @@ class Directory /// /// @return Array of directories in directory - ctnr::Array getDirectories() const; + container::Array getDirectories() const; /// @brief Get serialized directory /// diff --git a/include/OpenSpaceToolkit/Core/FileSystem/File.hpp b/include/OpenSpaceToolkit/Core/FileSystem/File.hpp index eac0ded9..4d316ab6 100644 --- a/include/OpenSpaceToolkit/Core/FileSystem/File.hpp +++ b/include/OpenSpaceToolkit/Core/FileSystem/File.hpp @@ -8,8 +8,8 @@ #include #include #include -#include -#include +#include +#include namespace ostk { @@ -20,7 +20,7 @@ namespace filesystem class Directory; -using ostk::core::types::Unique; +using ostk::core::type::Unique; /// @brief Computer resource for recording data discretely in a computer storage device /// diff --git a/include/OpenSpaceToolkit/Core/FileSystem/Path.hpp b/include/OpenSpaceToolkit/Core/FileSystem/Path.hpp index eba52897..a60424aa 100644 --- a/include/OpenSpaceToolkit/Core/FileSystem/Path.hpp +++ b/include/OpenSpaceToolkit/Core/FileSystem/Path.hpp @@ -5,8 +5,8 @@ #include -#include -#include +#include +#include namespace ostk { @@ -15,8 +15,8 @@ namespace core namespace filesystem { -using ostk::core::types::Unique; -using ostk::core::types::String; +using ostk::core::type::Unique; +using ostk::core::type::String; /// @brief diff --git a/include/OpenSpaceToolkit/Core/Logger.hpp b/include/OpenSpaceToolkit/Core/Logger.hpp index 4168c409..8c6dc084 100644 --- a/include/OpenSpaceToolkit/Core/Logger.hpp +++ b/include/OpenSpaceToolkit/Core/Logger.hpp @@ -5,23 +5,23 @@ #include -#include +#include #include #include #include #include -#include -#include +#include +#include namespace ostk { namespace core { -using ostk::core::types::Unique; -using ostk::core::types::Integer; -using ostk::core::types::String; -using ostk::core::ctnr::Array; +using ostk::core::type::Unique; +using ostk::core::type::Integer; +using ostk::core::type::String; +using ostk::core::container::Array; using ostk::core::logger::Severity; using ostk::core::logger::Source; using ostk::core::logger::Sink; diff --git a/include/OpenSpaceToolkit/Core/Logger/Pump.hpp b/include/OpenSpaceToolkit/Core/Logger/Pump.hpp index 66635642..301a2d53 100644 --- a/include/OpenSpaceToolkit/Core/Logger/Pump.hpp +++ b/include/OpenSpaceToolkit/Core/Logger/Pump.hpp @@ -5,9 +5,9 @@ #include #include -#include -#include -#include +#include +#include +#include namespace ostk { @@ -16,9 +16,9 @@ namespace core namespace logger { -using ostk::core::types::Unique; -using ostk::core::types::Integer; -using ostk::core::types::String; +using ostk::core::type::Unique; +using ostk::core::type::Integer; +using ostk::core::type::String; using ostk::core::logger::Severity; /// @brief Log pump diff --git a/include/OpenSpaceToolkit/Core/Logger/Sink.hpp b/include/OpenSpaceToolkit/Core/Logger/Sink.hpp index f10c09c4..d6f5d581 100644 --- a/include/OpenSpaceToolkit/Core/Logger/Sink.hpp +++ b/include/OpenSpaceToolkit/Core/Logger/Sink.hpp @@ -4,9 +4,9 @@ #define __OpenSpaceToolkit_Core_Logger_Sink__ #include -#include -#include -#include +#include +#include +#include namespace ostk { @@ -15,8 +15,8 @@ namespace core namespace logger { -using ostk::core::types::Unique; -using ostk::core::types::String; +using ostk::core::type::Unique; +using ostk::core::type::String; using ostk::core::logger::Severity; /// @brief Log sink @@ -24,7 +24,7 @@ using ostk::core::logger::Severity; class Sink { public: - Sink(const sinks::Sink& aSink); + Sink(const sink::Sink& aSink); Sink(const Sink& aSink); @@ -37,7 +37,7 @@ class Sink static Sink Console(const Severity& aSeverity); private: - Unique sinkUPtr_; + Unique sinkUPtr_; }; } // namespace logger diff --git a/include/OpenSpaceToolkit/Core/Logger/Sinks/Console.hpp b/include/OpenSpaceToolkit/Core/Logger/Sink/Console.hpp similarity index 78% rename from include/OpenSpaceToolkit/Core/Logger/Sinks/Console.hpp rename to include/OpenSpaceToolkit/Core/Logger/Sink/Console.hpp index 6093dd44..b1ad0b13 100644 --- a/include/OpenSpaceToolkit/Core/Logger/Sinks/Console.hpp +++ b/include/OpenSpaceToolkit/Core/Logger/Sink/Console.hpp @@ -1,10 +1,10 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Logger_Sinks_Console__ -#define __OpenSpaceToolkit_Core_Logger_Sinks_Console__ +#ifndef __OpenSpaceToolkit_Core_Logger_Sink_Console__ +#define __OpenSpaceToolkit_Core_Logger_Sink_Console__ -#include -#include +#include +#include namespace ostk { @@ -12,10 +12,10 @@ namespace core { namespace logger { -namespace sinks +namespace sink { -using ostk::core::types::Unique; +using ostk::core::type::Unique; using ostk::core::logger::Severity; /// @brief Log console sink @@ -66,7 +66,7 @@ class Console : public Sink Unique implUPtr_; }; -} // namespace sinks +} // namespace sink } // namespace logger } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Logger/Sinks/Sink.hpp b/include/OpenSpaceToolkit/Core/Logger/Sink/Sink.hpp similarity index 80% rename from include/OpenSpaceToolkit/Core/Logger/Sinks/Sink.hpp rename to include/OpenSpaceToolkit/Core/Logger/Sink/Sink.hpp index 375a459f..2e424f45 100644 --- a/include/OpenSpaceToolkit/Core/Logger/Sinks/Sink.hpp +++ b/include/OpenSpaceToolkit/Core/Logger/Sink/Sink.hpp @@ -1,11 +1,11 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Logger_Sinks_Sink__ -#define __OpenSpaceToolkit_Core_Logger_Sinks_Sink__ +#ifndef __OpenSpaceToolkit_Core_Logger_Sink_Sink__ +#define __OpenSpaceToolkit_Core_Logger_Sink_Sink__ -#include +#include #include -#include +#include namespace ostk { @@ -13,11 +13,11 @@ namespace core { namespace logger { -namespace sinks +namespace sink { -using ostk::core::types::String; -using ostk::core::ctnr::Array; +using ostk::core::type::String; +using ostk::core::container::Array; using ostk::core::logger::Severity; /// @brief Log sink base @@ -69,7 +69,7 @@ class Sink Array channels_; }; -} // namespace sinks +} // namespace sink } // namespace logger } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Logger/Source.hpp b/include/OpenSpaceToolkit/Core/Logger/Source.hpp index afcd4840..81599ef7 100644 --- a/include/OpenSpaceToolkit/Core/Logger/Source.hpp +++ b/include/OpenSpaceToolkit/Core/Logger/Source.hpp @@ -3,9 +3,9 @@ #ifndef __OpenSpaceToolkit_Core_Logger_Source__ #define __OpenSpaceToolkit_Core_Logger_Source__ -#include -#include -#include +#include +#include +#include namespace ostk { @@ -14,8 +14,8 @@ namespace core namespace logger { -using ostk::core::types::Unique; -using ostk::core::types::String; +using ostk::core::type::Unique; +using ostk::core::type::String; /// @brief Log source @@ -34,7 +34,7 @@ class Source // private: - Unique sourceUPtr_; + Unique sourceUPtr_; }; } // namespace logger diff --git a/include/OpenSpaceToolkit/Core/Logger/Sources/Source.hpp b/include/OpenSpaceToolkit/Core/Logger/Source/Source.hpp similarity index 60% rename from include/OpenSpaceToolkit/Core/Logger/Sources/Source.hpp rename to include/OpenSpaceToolkit/Core/Logger/Source/Source.hpp index f79a7d7b..c15b75b4 100644 --- a/include/OpenSpaceToolkit/Core/Logger/Sources/Source.hpp +++ b/include/OpenSpaceToolkit/Core/Logger/Source/Source.hpp @@ -1,12 +1,12 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Logger_Sources_Source__ -#define __OpenSpaceToolkit_Core_Logger_Sources_Source__ +#ifndef __OpenSpaceToolkit_Core_Logger_Source_Source__ +#define __OpenSpaceToolkit_Core_Logger_Source_Source__ -#include +#include #include -#include -#include +#include +#include namespace ostk { @@ -14,12 +14,12 @@ namespace core { namespace logger { -namespace sources +namespace source { -using ostk::core::types::Unique; -using ostk::core::types::String; -using ostk::core::ctnr::Array; +using ostk::core::type::Unique; +using ostk::core::type::String; +using ostk::core::container::Array; using ostk::core::logger::Severity; /// @brief Log source base @@ -47,7 +47,7 @@ class Source Unique implPtr_; }; -} // namespace sources +} // namespace source } // namespace logger } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/System/Group.hpp b/include/OpenSpaceToolkit/Core/System/Group.hpp index d7b87f4a..230d11fe 100644 --- a/include/OpenSpaceToolkit/Core/System/Group.hpp +++ b/include/OpenSpaceToolkit/Core/System/Group.hpp @@ -3,7 +3,7 @@ #ifndef __OpenSpaceToolkit_Core_System_Group__ #define __OpenSpaceToolkit_Core_System_Group__ -#include +#include namespace ostk { @@ -12,7 +12,7 @@ namespace core namespace system { -using ostk::core::types::String; +using ostk::core::type::String; /// @brief Group /// diff --git a/include/OpenSpaceToolkit/Core/System/User.hpp b/include/OpenSpaceToolkit/Core/System/User.hpp index 1dba2d63..a43c5d45 100644 --- a/include/OpenSpaceToolkit/Core/System/User.hpp +++ b/include/OpenSpaceToolkit/Core/System/User.hpp @@ -3,7 +3,7 @@ #ifndef __OpenSpaceToolkit_Core_System_User__ #define __OpenSpaceToolkit_Core_System_User__ -#include +#include namespace ostk { @@ -12,7 +12,7 @@ namespace core namespace system { -using ostk::core::types::String; +using ostk::core::type::String; /// @brief User /// diff --git a/include/OpenSpaceToolkit/Core/Type.hpp b/include/OpenSpaceToolkit/Core/Type.hpp new file mode 100644 index 00000000..6304b2dd --- /dev/null +++ b/include/OpenSpaceToolkit/Core/Type.hpp @@ -0,0 +1,16 @@ +/// Apache License 2.0 + +#ifndef __OpenSpaceToolkit_Core_Type__ +#define __OpenSpaceToolkit_Core_Type__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/OpenSpaceToolkit/Core/Types/Byte.hpp b/include/OpenSpaceToolkit/Core/Type/Byte.hpp similarity index 62% rename from include/OpenSpaceToolkit/Core/Types/Byte.hpp rename to include/OpenSpaceToolkit/Core/Type/Byte.hpp index 7817c7f1..e478a075 100644 --- a/include/OpenSpaceToolkit/Core/Types/Byte.hpp +++ b/include/OpenSpaceToolkit/Core/Type/Byte.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_Byte__ -#define __OpenSpaceToolkit_Core_Types_Byte__ +#ifndef __OpenSpaceToolkit_Core_Type_Byte__ +#define __OpenSpaceToolkit_Core_Type_Byte__ #include @@ -9,14 +9,14 @@ namespace ostk { namespace core { -namespace types +namespace type { /// @brief A unit of digital information that consists of eight bits using Byte = uint8_t; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types/ByteArray.hpp b/include/OpenSpaceToolkit/Core/Type/ByteArray.hpp similarity index 50% rename from include/OpenSpaceToolkit/Core/Types/ByteArray.hpp rename to include/OpenSpaceToolkit/Core/Type/ByteArray.hpp index 930c662c..0b2b621f 100644 --- a/include/OpenSpaceToolkit/Core/Types/ByteArray.hpp +++ b/include/OpenSpaceToolkit/Core/Type/ByteArray.hpp @@ -1,16 +1,16 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_ByteArray__ -#define __OpenSpaceToolkit_Core_Types_ByteArray__ +#ifndef __OpenSpaceToolkit_Core_Type_ByteArray__ +#define __OpenSpaceToolkit_Core_Type_ByteArray__ -#include -#include +#include +#include namespace ostk { namespace core { -namespace types +namespace type { /// @brief An array of bytes [TBI] @@ -24,7 +24,7 @@ class ByteArray Array bytes_; }; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types/Index.hpp b/include/OpenSpaceToolkit/Core/Type/Index.hpp similarity index 67% rename from include/OpenSpaceToolkit/Core/Types/Index.hpp rename to include/OpenSpaceToolkit/Core/Type/Index.hpp index 3449b434..1398bbc6 100644 --- a/include/OpenSpaceToolkit/Core/Types/Index.hpp +++ b/include/OpenSpaceToolkit/Core/Type/Index.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_Index__ -#define __OpenSpaceToolkit_Core_Types_Index__ +#ifndef __OpenSpaceToolkit_Core_Type_Index__ +#define __OpenSpaceToolkit_Core_Type_Index__ #include @@ -9,14 +9,14 @@ namespace ostk { namespace core { -namespace types +namespace type { /// @brief Index can store the maximum size of a theoretically possible object of any type typedef size_t Index; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types/Integer.hpp b/include/OpenSpaceToolkit/Core/Type/Integer.hpp similarity index 87% rename from include/OpenSpaceToolkit/Core/Types/Integer.hpp rename to include/OpenSpaceToolkit/Core/Type/Integer.hpp index 6ba5f5d6..11e64129 100644 --- a/include/OpenSpaceToolkit/Core/Types/Integer.hpp +++ b/include/OpenSpaceToolkit/Core/Type/Integer.hpp @@ -1,20 +1,20 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_Integer__ -#define __OpenSpaceToolkit_Core_Types_Integer__ +#ifndef __OpenSpaceToolkit_Core_Type_Integer__ +#define __OpenSpaceToolkit_Core_Type_Integer__ #include -#include -#include -#include -#include +#include +#include +#include +#include namespace ostk { namespace core { -namespace types +namespace type { typedef int8_t Int8; @@ -209,9 +209,9 @@ class Integer bool isEven() const; bool isOdd() const; - types::Sign getSign() const; + type::Sign getSign() const; - types::String toString() const; + type::String toString() const; static Integer Undefined(); @@ -221,33 +221,33 @@ class Integer static Integer NegativeInfinity(); - static Integer Int8(types::Int8 anInteger); + static Integer Int8(type::Int8 anInteger); - static Integer Int16(types::Int16 anInteger); + static Integer Int16(type::Int16 anInteger); - static Integer Int32(types::Int32 anInteger); + static Integer Int32(type::Int32 anInteger); - static Integer Int64(types::Int64 anInteger); + static Integer Int64(type::Int64 anInteger); - static Integer Uint8(types::Uint8 anInteger); + static Integer Uint8(type::Uint8 anInteger); - static Integer Uint16(types::Uint16 anInteger); + static Integer Uint16(type::Uint16 anInteger); - static Integer Uint32(types::Uint32 anInteger); + static Integer Uint32(type::Uint32 anInteger); - static Integer Uint64(types::Uint64 anInteger); + static Integer Uint64(type::Uint64 anInteger); - static Integer Index(const types::Index& anIndex); + static Integer Index(const type::Index& anIndex); - static Integer Size(const types::Size& aSize); + static Integer Size(const type::Size& aSize); static bool CanParse(char aCharacter); - static bool CanParse(const types::String& aString); + static bool CanParse(const type::String& aString); static Integer Parse(char aCharacter); - static Integer Parse(const types::String& aString); + static Integer Parse(const type::String& aString); private: enum class Type @@ -266,7 +266,7 @@ class Integer Integer(const Integer::Type& aType, const Integer::ValueType& anInteger); }; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types/Real.hpp b/include/OpenSpaceToolkit/Core/Type/Real.hpp similarity index 83% rename from include/OpenSpaceToolkit/Core/Types/Real.hpp rename to include/OpenSpaceToolkit/Core/Type/Real.hpp index 79a31eca..e5e2039d 100644 --- a/include/OpenSpaceToolkit/Core/Types/Real.hpp +++ b/include/OpenSpaceToolkit/Core/Type/Real.hpp @@ -1,17 +1,17 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_Real__ -#define __OpenSpaceToolkit_Core_Types_Real__ +#ifndef __OpenSpaceToolkit_Core_Type_Real__ +#define __OpenSpaceToolkit_Core_Type_Real__ -#include -#include -#include +#include +#include +#include namespace ostk { namespace core { -namespace types +namespace type { /// @brief Real type @@ -93,15 +93,15 @@ class Real bool isNear(const Real& aValue, const Real& aTolerance = Real::Epsilon()) const; - types::Sign getSign() const; + type::Sign getSign() const; - types::String toString(const types::Integer& aPrecision = types::Integer::Undefined()) const; + type::String toString(const type::Integer& aPrecision = type::Integer::Undefined()) const; - types::Integer toInteger() const; + type::Integer toInteger() const; Real abs() const; - types::Integer floor() const; + type::Integer floor() const; Real sqrt() const; @@ -121,11 +121,11 @@ class Real static Real NegativeInfinity(); - static Real Integer(const types::Integer& anInteger); + static Real Integer(const type::Integer& anInteger); - static Real CanParse(const types::String& aString); + static Real CanParse(const type::String& aString); - static Real Parse(const types::String& aString); + static Real Parse(const type::String& aString); private: enum class Type @@ -144,7 +144,7 @@ class Real Real(const Real::Type& aType, const Real::ValueType& aReal); }; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types/Shared.hpp b/include/OpenSpaceToolkit/Core/Type/Shared.hpp similarity index 69% rename from include/OpenSpaceToolkit/Core/Types/Shared.hpp rename to include/OpenSpaceToolkit/Core/Type/Shared.hpp index 0488ebd2..fe1e6712 100644 --- a/include/OpenSpaceToolkit/Core/Types/Shared.hpp +++ b/include/OpenSpaceToolkit/Core/Type/Shared.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_Shared__ -#define __OpenSpaceToolkit_Core_Types_Shared__ +#ifndef __OpenSpaceToolkit_Core_Type_Shared__ +#define __OpenSpaceToolkit_Core_Type_Shared__ #include #include @@ -10,7 +10,7 @@ namespace ostk { namespace core { -namespace types +namespace type { /// @brief Retains shared ownership of an object through a pointer @@ -18,7 +18,7 @@ namespace types template using Shared = std::shared_ptr; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types/Sign.hpp b/include/OpenSpaceToolkit/Core/Type/Sign.hpp similarity index 67% rename from include/OpenSpaceToolkit/Core/Types/Sign.hpp rename to include/OpenSpaceToolkit/Core/Type/Sign.hpp index d7ab1f0a..9a0b26a6 100644 --- a/include/OpenSpaceToolkit/Core/Types/Sign.hpp +++ b/include/OpenSpaceToolkit/Core/Type/Sign.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_Sign__ -#define __OpenSpaceToolkit_Core_Types_Sign__ +#ifndef __OpenSpaceToolkit_Core_Type_Sign__ +#define __OpenSpaceToolkit_Core_Type_Sign__ #include @@ -9,7 +9,7 @@ namespace ostk { namespace core { -namespace types +namespace type { /// @brief Sign enum @@ -24,7 +24,7 @@ enum class Sign : uint8_t }; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types/Size.hpp b/include/OpenSpaceToolkit/Core/Type/Size.hpp similarity index 63% rename from include/OpenSpaceToolkit/Core/Types/Size.hpp rename to include/OpenSpaceToolkit/Core/Type/Size.hpp index fcdd2c1d..e8e60341 100644 --- a/include/OpenSpaceToolkit/Core/Types/Size.hpp +++ b/include/OpenSpaceToolkit/Core/Type/Size.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_Size__ -#define __OpenSpaceToolkit_Core_Types_Size__ +#ifndef __OpenSpaceToolkit_Core_Type_Size__ +#define __OpenSpaceToolkit_Core_Type_Size__ #include @@ -9,14 +9,14 @@ namespace ostk { namespace core { -namespace types +namespace type { /// @brief Size can store the maximum size of a theoretically possible object of any type typedef size_t Size; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types/String.hpp b/include/OpenSpaceToolkit/Core/Type/String.hpp similarity index 88% rename from include/OpenSpaceToolkit/Core/Types/String.hpp rename to include/OpenSpaceToolkit/Core/Type/String.hpp index 7a374601..ce16f474 100644 --- a/include/OpenSpaceToolkit/Core/Types/String.hpp +++ b/include/OpenSpaceToolkit/Core/Type/String.hpp @@ -1,10 +1,10 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_String__ -#define __OpenSpaceToolkit_Core_Types_String__ +#ifndef __OpenSpaceToolkit_Core_Type_String__ +#define __OpenSpaceToolkit_Core_Type_String__ -#include -#include +#include +#include #define FMT_HEADER_ONLY #include @@ -20,18 +20,18 @@ namespace core { // Forward declare Array to avoid circular dependency -namespace ctnr +namespace container { template class Array; } -namespace types +namespace type { -using ostk::core::types::Index; -using ostk::core::types::Size; -using ostk::core::ctnr::Array; +using ostk::core::type::Index; +using ostk::core::type::Size; +using ostk::core::container::Array; /// @brief A sequence of characters /// @note The current implementation (derived for std::string) is temporary, as this type of @@ -176,7 +176,7 @@ typename std::enable_if::value, std::string>::type CallToString(T return t->toString(); } -} // namespace types +} // namespace type } // namespace core } // namespace ostk @@ -184,9 +184,9 @@ namespace std { template <> -struct hash +struct hash { - typedef ostk::core::types::String argument_type; + typedef ostk::core::type::String argument_type; typedef std::size_t result_type; result_type operator()(const argument_type& aString) const diff --git a/include/OpenSpaceToolkit/Core/Types/Unique.hpp b/include/OpenSpaceToolkit/Core/Type/Unique.hpp similarity index 68% rename from include/OpenSpaceToolkit/Core/Types/Unique.hpp rename to include/OpenSpaceToolkit/Core/Type/Unique.hpp index adf992b9..260840d6 100644 --- a/include/OpenSpaceToolkit/Core/Types/Unique.hpp +++ b/include/OpenSpaceToolkit/Core/Type/Unique.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_Unique__ -#define __OpenSpaceToolkit_Core_Types_Unique__ +#ifndef __OpenSpaceToolkit_Core_Type_Unique__ +#define __OpenSpaceToolkit_Core_Type_Unique__ #include #include @@ -10,7 +10,7 @@ namespace ostk { namespace core { -namespace types +namespace type { /// @brief Owns and manages another object through a pointer @@ -18,7 +18,7 @@ namespace types template using Unique = std::unique_ptr; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types/Weak.hpp b/include/OpenSpaceToolkit/Core/Type/Weak.hpp similarity index 70% rename from include/OpenSpaceToolkit/Core/Types/Weak.hpp rename to include/OpenSpaceToolkit/Core/Type/Weak.hpp index 1dd1cfbc..09742c5b 100644 --- a/include/OpenSpaceToolkit/Core/Types/Weak.hpp +++ b/include/OpenSpaceToolkit/Core/Type/Weak.hpp @@ -1,7 +1,7 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Types_Weak__ -#define __OpenSpaceToolkit_Core_Types_Weak__ +#ifndef __OpenSpaceToolkit_Core_Type_Weak__ +#define __OpenSpaceToolkit_Core_Type_Weak__ #include #include @@ -10,7 +10,7 @@ namespace ostk { namespace core { -namespace types +namespace type { /// @brief Holds a non-owning reference to an object that is managed by Shared @@ -18,7 +18,7 @@ namespace types template using Weak = std::weak_ptr; -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/include/OpenSpaceToolkit/Core/Types.hpp b/include/OpenSpaceToolkit/Core/Types.hpp deleted file mode 100644 index 3f401e5b..00000000 --- a/include/OpenSpaceToolkit/Core/Types.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/// Apache License 2.0 - -#ifndef __OpenSpaceToolkit_Core_Types__ -#define __OpenSpaceToolkit_Core_Types__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/include/OpenSpaceToolkit/Core/Utilities.hpp b/include/OpenSpaceToolkit/Core/Utilities.hpp deleted file mode 100644 index cfa55470..00000000 --- a/include/OpenSpaceToolkit/Core/Utilities.hpp +++ /dev/null @@ -1,10 +0,0 @@ -/// Apache License 2.0 - -#ifndef __OpenSpaceToolkit_Core_Utilities__ -#define __OpenSpaceToolkit_Core_Utilities__ - -#include - -#include - -#endif diff --git a/include/OpenSpaceToolkit/Core/Utility.hpp b/include/OpenSpaceToolkit/Core/Utility.hpp new file mode 100644 index 00000000..ba1cf904 --- /dev/null +++ b/include/OpenSpaceToolkit/Core/Utility.hpp @@ -0,0 +1,10 @@ +/// Apache License 2.0 + +#ifndef __OpenSpaceToolkit_Core_Utility__ +#define __OpenSpaceToolkit_Core_Utility__ + +#include + +#include + +#endif diff --git a/include/OpenSpaceToolkit/Core/Utilities/Print.hpp b/include/OpenSpaceToolkit/Core/Utility/Print.hpp similarity index 79% rename from include/OpenSpaceToolkit/Core/Utilities/Print.hpp rename to include/OpenSpaceToolkit/Core/Utility/Print.hpp index 0276cb87..9b2b0b5b 100644 --- a/include/OpenSpaceToolkit/Core/Utilities/Print.hpp +++ b/include/OpenSpaceToolkit/Core/Utility/Print.hpp @@ -1,12 +1,12 @@ /// Apache License 2.0 -#ifndef __OpenSpaceToolkit_Core_Utilities_Print__ -#define __OpenSpaceToolkit_Core_Utilities_Print__ +#ifndef __OpenSpaceToolkit_Core_Utility_Print__ +#define __OpenSpaceToolkit_Core_Utility_Print__ #include #include -#include +#include namespace ostk { @@ -44,11 +44,11 @@ class Print Print() = delete; - static void Header(std::ostream& anOutputStream, const types::String& aName); + static void Header(std::ostream& anOutputStream, const type::String& aName); static Print::LineBuffer Line(std::ostream& anOutputStream, uint anIndentation = 1); - static void Separator(std::ostream& anOutputStream, const types::String& aName = ""); + static void Separator(std::ostream& anOutputStream, const type::String& aName = ""); static void Footer(std::ostream& anOutputStream); }; diff --git a/share/util/Test.cxx b/share/util/Test.cxx index 7644f8cf..a3c14ccc 100644 --- a/share/util/Test.cxx +++ b/share/util/Test.cxx @@ -31,7 +31,7 @@ int main() { LOG_SCOPE("Test"); - using ostk::core::types::Integer; + using ostk::core::type::Integer; using ostk::core::Logger; using ostk::core::logger::Severity; diff --git a/src/OpenSpaceToolkit/Core/Containers/Array.tpp b/src/OpenSpaceToolkit/Core/Container/Array.tpp similarity index 91% rename from src/OpenSpaceToolkit/Core/Containers/Array.tpp rename to src/OpenSpaceToolkit/Core/Container/Array.tpp index 830cc654..931ca1c9 100644 --- a/src/OpenSpaceToolkit/Core/Containers/Array.tpp +++ b/src/OpenSpaceToolkit/Core/Container/Array.tpp @@ -3,13 +3,13 @@ #include #include -#include +#include namespace ostk { namespace core { -namespace ctnr +namespace container { template @@ -119,7 +119,7 @@ bool Array::isNear(const Array& anArray, const T& aTolerance) const return false; } - for (const auto elementTuple : ostk::core::ctnr::iterators::Zip(*this, anArray)) + for (const auto elementTuple : ostk::core::container::iterator::Zip(*this, anArray)) { if (!std::get<0>(elementTuple).isNear(std::get<1>(elementTuple), aTolerance)) { @@ -138,7 +138,7 @@ bool Array::isNear(const Array& anArray, const std::function(elementTuple), std::get<1>(elementTuple))) { @@ -169,28 +169,28 @@ Index Array::getIndexOf(const T& anElement) const } template -typename std::enable_if::value, types::String>::type extractString(const T& aType) +typename std::enable_if::value, type::String>::type extractString(const T& aType) { return aType.toString(); } template -typename std::enable_if::value, types::String>::type extractString(const T& aType) +typename std::enable_if::value, type::String>::type extractString(const T& aType) { return "\"" + aType + "\""; } // template -// typename std::enable_if::value, types::String>::type extractString (const T& +// typename std::enable_if::value, type::String>::type extractString (const T& // aType) // { // return aType ; // } template -types::String Array::toString() const +type::String Array::toString() const { - types::String string = "["; + type::String string = "["; for (const auto& item : (*this)) { @@ -373,6 +373,6 @@ Array Array::Empty() return std::move(std::vector()); } -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/src/OpenSpaceToolkit/Core/Containers/Dictionary.cpp b/src/OpenSpaceToolkit/Core/Container/Dictionary.cpp similarity index 96% rename from src/OpenSpaceToolkit/Core/Containers/Dictionary.cpp rename to src/OpenSpaceToolkit/Core/Container/Dictionary.cpp index 65ee80cb..2568752a 100644 --- a/src/OpenSpaceToolkit/Core/Containers/Dictionary.cpp +++ b/src/OpenSpaceToolkit/Core/Container/Dictionary.cpp @@ -2,15 +2,15 @@ #include -#include +#include #include -#include +#include namespace ostk { namespace core { -namespace ctnr +namespace container { Dictionary::Iterator::Iterator() {} @@ -283,7 +283,7 @@ Dictionary::Value& Dictionary::operator[](const Dictionary::Key& aKey) std::ostream& operator<<(std::ostream& anOutputStream, const Dictionary& aDictionary) { std::function printDictionary; - std::function&, uint)> printArray; + std::function&, uint)> printArray; printDictionary = [&printDictionary, &printArray, &anOutputStream](const Dictionary& dictionary, uint anIndentation) { @@ -312,9 +312,9 @@ std::ostream& operator<<(std::ostream& anOutputStream, const Dictionary& aDictio } }; - printArray = [&printArray, &printDictionary, &anOutputStream](const ctnr::Array& array, uint anIndentation) + printArray = [&printArray, &printDictionary, &anOutputStream](const container::Array& array, uint anIndentation) { - types::Integer index = 0; + type::Integer index = 0; for (const auto& arrayElement : array) { @@ -426,6 +426,6 @@ Dictionary Dictionary::Parse(const String& aString, const Object::Format& aForma Dictionary::Dictionary() {} -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/src/OpenSpaceToolkit/Core/Containers/Object.cpp b/src/OpenSpaceToolkit/Core/Container/Object.cpp similarity index 79% rename from src/OpenSpaceToolkit/Core/Containers/Object.cpp rename to src/OpenSpaceToolkit/Core/Container/Object.cpp index e589893f..136366be 100644 --- a/src/OpenSpaceToolkit/Core/Containers/Object.cpp +++ b/src/OpenSpaceToolkit/Core/Container/Object.cpp @@ -8,17 +8,17 @@ #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include namespace ostk { namespace core { -namespace ctnr +namespace container { class Object::Impl @@ -41,20 +41,20 @@ class Object::Impl bool isArray() const; const bool& accessBoolean() const; - const types::Integer& accessInteger() const; - const types::Real& accessReal() const; - const types::String& accessString() const; - const ctnr::Dictionary& accessDictionary() const; - const ctnr::Array& accessArray() const; + const type::Integer& accessInteger() const; + const type::Real& accessReal() const; + const type::String& accessString() const; + const container::Dictionary& accessDictionary() const; + const container::Array& accessArray() const; Object::Type getType() const; bool& accessBoolean(); - types::Integer& accessInteger(); - types::Real& accessReal(); - types::String& accessString(); - ctnr::Dictionary& accessDictionary(); - ctnr::Array& accessArray(); + type::Integer& accessInteger(); + type::Real& accessReal(); + type::String& accessString(); + container::Dictionary& accessDictionary(); + container::Array& accessArray(); private: boost::any value_; @@ -82,30 +82,30 @@ bool Object::Impl::operator==(const Object::Impl& anObject) const return boost::any_cast(value_) == boost::any_cast(anObject.value_); } - if (value_.type() == typeid(types::Integer)) + if (value_.type() == typeid(type::Integer)) { - return boost::any_cast(value_) == boost::any_cast(anObject.value_); + return boost::any_cast(value_) == boost::any_cast(anObject.value_); } - if (value_.type() == typeid(types::Real)) + if (value_.type() == typeid(type::Real)) { - return boost::any_cast(value_) == boost::any_cast(anObject.value_); + return boost::any_cast(value_) == boost::any_cast(anObject.value_); } - if (value_.type() == typeid(types::String)) + if (value_.type() == typeid(type::String)) { - return boost::any_cast(value_) == boost::any_cast(anObject.value_); + return boost::any_cast(value_) == boost::any_cast(anObject.value_); } - if (value_.type() == typeid(ctnr::Array)) + if (value_.type() == typeid(container::Array)) { - return boost::any_cast>(value_) == - boost::any_cast>(anObject.value_); + return boost::any_cast>(value_) == + boost::any_cast>(anObject.value_); } - if (value_.type() == typeid(ctnr::Dictionary)) + if (value_.type() == typeid(container::Dictionary)) { - return boost::any_cast(value_) == boost::any_cast(anObject.value_); + return boost::any_cast(value_) == boost::any_cast(anObject.value_); } throw ostk::core::error::runtime::Wrong("Type"); @@ -125,27 +125,27 @@ bool Object::Impl::isBoolean() const bool Object::Impl::isInteger() const { - return value_.type() == typeid(types::Integer); + return value_.type() == typeid(type::Integer); } bool Object::Impl::isReal() const { - return value_.type() == typeid(types::Real); + return value_.type() == typeid(type::Real); } bool Object::Impl::isString() const { - return value_.type() == typeid(types::String); + return value_.type() == typeid(type::String); } bool Object::Impl::isDictionary() const { - return value_.type() == typeid(ctnr::Dictionary); + return value_.type() == typeid(container::Dictionary); } bool Object::Impl::isArray() const { - return value_.type() == typeid(ctnr::Array); + return value_.type() == typeid(container::Array); } const bool& Object::Impl::accessBoolean() const @@ -158,51 +158,51 @@ const bool& Object::Impl::accessBoolean() const throw ostk::core::error::RuntimeError("Object is not of type [Boolean]."); } -const types::Integer& Object::Impl::accessInteger() const +const type::Integer& Object::Impl::accessInteger() const { if (this->isInteger()) { - return boost::any_cast(value_); + return boost::any_cast(value_); } throw ostk::core::error::RuntimeError("Object is not of type [Integer]."); } -const types::Real& Object::Impl::accessReal() const +const type::Real& Object::Impl::accessReal() const { if (this->isReal()) { - return boost::any_cast(value_); + return boost::any_cast(value_); } throw ostk::core::error::RuntimeError("Object is not of type [Real]."); } -const types::String& Object::Impl::accessString() const +const type::String& Object::Impl::accessString() const { if (this->isString()) { - return boost::any_cast(value_); + return boost::any_cast(value_); } throw ostk::core::error::RuntimeError("Object is not of type [String]."); } -const ctnr::Dictionary& Object::Impl::accessDictionary() const +const container::Dictionary& Object::Impl::accessDictionary() const { if (this->isDictionary()) { - return boost::any_cast(value_); + return boost::any_cast(value_); } throw ostk::core::error::RuntimeError("Object is not of type [Dictionary]."); } -const ctnr::Array& Object::Impl::accessArray() const +const container::Array& Object::Impl::accessArray() const { if (this->isArray()) { - return boost::any_cast&>(value_); + return boost::any_cast&>(value_); } throw ostk::core::error::RuntimeError("Object is not of type [Array]."); @@ -253,58 +253,58 @@ bool& Object::Impl::accessBoolean() throw ostk::core::error::RuntimeError("Object is not of type [Boolean]."); } -types::Integer& Object::Impl::accessInteger() +type::Integer& Object::Impl::accessInteger() { if (this->isInteger()) { - return boost::any_cast(value_); + return boost::any_cast(value_); } throw ostk::core::error::RuntimeError("Object is not of type [Integer]."); } -types::Real& Object::Impl::accessReal() +type::Real& Object::Impl::accessReal() { if (this->isReal()) { - return boost::any_cast(value_); + return boost::any_cast(value_); } throw ostk::core::error::RuntimeError("Object is not of type [Real]."); } -types::String& Object::Impl::accessString() +type::String& Object::Impl::accessString() { if (this->isString()) { - return boost::any_cast(value_); + return boost::any_cast(value_); } throw ostk::core::error::RuntimeError("Object is not of type [String]."); } -ctnr::Dictionary& Object::Impl::accessDictionary() +container::Dictionary& Object::Impl::accessDictionary() { if (this->isDictionary()) { - return boost::any_cast(value_); + return boost::any_cast(value_); } throw ostk::core::error::RuntimeError("Object is not of type [Dictionary]."); } -ctnr::Array& Object::Impl::accessArray() +container::Array& Object::Impl::accessArray() { if (this->isArray()) { - return boost::any_cast&>(value_); + return boost::any_cast&>(value_); } throw ostk::core::error::RuntimeError("Object is not of type [Array]."); } -Object::Object(std::initializer_list> aList) - : objectImplUPtr_(std::make_unique(boost::any(ctnr::Dictionary(aList)))) +Object::Object(std::initializer_list> aList) + : objectImplUPtr_(std::make_unique(boost::any(container::Dictionary(aList)))) { } @@ -337,7 +337,7 @@ bool Object::operator!=(const Object& anObject) const return !((*this) == anObject); } -const Object& Object::operator[](const types::String& aKey) const +const Object& Object::operator[](const type::String& aKey) const { LOG_SCOPE("Object", "operator [String]"); @@ -349,7 +349,7 @@ const Object& Object::operator[](const types::String& aKey) const return this->accessDictionary()[aKey]; } -const Object& Object::operator[](const types::Index& anIndex) const +const Object& Object::operator[](const type::Index& anIndex) const { LOG_SCOPE("Object", "operator [Index]"); @@ -361,7 +361,7 @@ const Object& Object::operator[](const types::Index& anIndex) const return this->accessArray()[anIndex]; } -Object& Object::operator[](const types::String& aKey) +Object& Object::operator[](const type::String& aKey) { LOG_SCOPE("Object", "operator [String]"); @@ -373,21 +373,21 @@ Object& Object::operator[](const types::String& aKey) return this->accessDictionary()[aKey]; } -Object& Object::operator[](const types::Index& anIndex) +Object& Object::operator[](const type::Index& anIndex) { LOG_SCOPE("Object", "operator [Index]"); if (!this->isArray()) { - objectImplUPtr_ = std::make_unique(boost::any(ctnr::Array::Empty())); + objectImplUPtr_ = std::make_unique(boost::any(container::Array::Empty())); } - ctnr::Array& array = this->accessArray(); + container::Array& array = this->accessArray(); if (anIndex >= array.getSize()) { - ctnr::Array undefinedObjectArray = - ctnr::Array((anIndex - array.getSize() + 1), Object::Undefined()); + container::Array undefinedObjectArray = + container::Array((anIndex - array.getSize() + 1), Object::Undefined()); array.insert(array.end(), undefinedObjectArray.begin(), undefinedObjectArray.end()); } @@ -519,7 +519,7 @@ const bool& Object::accessBoolean() const return objectImplUPtr_->accessBoolean(); } -const types::Integer& Object::accessInteger() const +const type::Integer& Object::accessInteger() const { if (!this->isDefined()) { @@ -529,7 +529,7 @@ const types::Integer& Object::accessInteger() const return objectImplUPtr_->accessInteger(); } -const types::Real& Object::accessReal() const +const type::Real& Object::accessReal() const { if (!this->isDefined()) { @@ -539,7 +539,7 @@ const types::Real& Object::accessReal() const return objectImplUPtr_->accessReal(); } -const types::String& Object::accessString() const +const type::String& Object::accessString() const { if (!this->isDefined()) { @@ -549,7 +549,7 @@ const types::String& Object::accessString() const return objectImplUPtr_->accessString(); } -const ctnr::Dictionary& Object::accessDictionary() const +const container::Dictionary& Object::accessDictionary() const { if (!this->isDefined()) { @@ -559,7 +559,7 @@ const ctnr::Dictionary& Object::accessDictionary() const return objectImplUPtr_->accessDictionary(); } -const ctnr::Array& Object::accessArray() const +const container::Array& Object::accessArray() const { if (!this->isDefined()) { @@ -579,32 +579,32 @@ bool Object::getBoolean() const return this->accessBoolean(); } -types::Integer Object::getInteger() const +type::Integer Object::getInteger() const { return this->accessInteger(); } -types::Real Object::getReal() const +type::Real Object::getReal() const { return this->accessReal(); } -types::String Object::getString() const +type::String Object::getString() const { return this->accessString(); } -ctnr::Dictionary Object::getDictionary() const +container::Dictionary Object::getDictionary() const { return this->accessDictionary(); } -ctnr::Array Object::getArray() const +container::Array Object::getArray() const { return this->accessArray(); } -types::String Object::toString(const Object::Format& aFormat) const +type::String Object::toString(const Object::Format& aFormat) const { LOG_SCOPE("Object", "toString"); @@ -626,10 +626,10 @@ types::String Object::toString(const Object::Format& aFormat) const throw ostk::core::error::runtime::Wrong("Format"); - return types::String::Empty(); + return type::String::Empty(); } -types::String Object::getJsonString() const +type::String Object::getJsonString() const { LOG_SCOPE("Object", "getJsonString"); @@ -652,7 +652,7 @@ types::String Object::getJsonString() const case Object::Type::Integer: { - const types::Integer& integer = anObject.accessInteger(); + const type::Integer& integer = anObject.accessInteger(); if (integer.isDefined() && integer.isFinite()) { @@ -660,7 +660,7 @@ types::String Object::getJsonString() const } else { - const types::String string = integer.toString(); + const type::String string = integer.toString(); value.SetString(string.data(), string.length()); } @@ -741,7 +741,7 @@ bool& Object::accessBoolean() return objectImplUPtr_->accessBoolean(); } -types::Integer& Object::accessInteger() +type::Integer& Object::accessInteger() { if (!this->isDefined()) { @@ -751,7 +751,7 @@ types::Integer& Object::accessInteger() return objectImplUPtr_->accessInteger(); } -types::Real& Object::accessReal() +type::Real& Object::accessReal() { if (!this->isDefined()) { @@ -761,7 +761,7 @@ types::Real& Object::accessReal() return objectImplUPtr_->accessReal(); } -types::String& Object::accessString() +type::String& Object::accessString() { if (!this->isDefined()) { @@ -771,7 +771,7 @@ types::String& Object::accessString() return objectImplUPtr_->accessString(); } -ctnr::Dictionary& Object::accessDictionary() +container::Dictionary& Object::accessDictionary() { if (!this->isDefined()) { @@ -781,7 +781,7 @@ ctnr::Dictionary& Object::accessDictionary() return objectImplUPtr_->accessDictionary(); } -ctnr::Array& Object::accessArray() +container::Array& Object::accessArray() { if (!this->isDefined()) { @@ -801,32 +801,32 @@ Object Object::Boolean(const bool& aBoolean) return Object(std::make_unique(boost::any(aBoolean))); } -Object Object::Integer(const types::Integer& anInteger) +Object Object::Integer(const type::Integer& anInteger) { return Object(std::make_unique(boost::any(anInteger))); } -Object Object::Real(const types::Real& aReal) +Object Object::Real(const type::Real& aReal) { return Object(std::make_unique(boost::any(aReal))); } -Object Object::String(const types::String& aString) +Object Object::String(const type::String& aString) { return Object(std::make_unique(boost::any(aString))); } -Object Object::Dictionary(const ctnr::Dictionary& aDictionary) +Object Object::Dictionary(const container::Dictionary& aDictionary) { return Object(std::make_unique(boost::any(aDictionary))); } -Object Object::Array(const ctnr::Array& anArray) +Object Object::Array(const container::Array& anArray) { return Object(std::make_unique(boost::any(anArray))); } -Object Object::Parse(const types::String& aString, const Object::Format& aFormat) +Object Object::Parse(const type::String& aString, const Object::Format& aFormat) { switch (aFormat) { @@ -861,7 +861,7 @@ Object Object::Parse(const types::String& aString, const Object::Format& aFormat return Object::Undefined(); } -Object Object::ParseJson(const types::String& aString) +Object Object::ParseJson(const type::String& aString) { LOG_SCOPE("Object", "ParseJson"); @@ -898,13 +898,13 @@ Object Object::ParseJson(const types::String& aString) } else if (aJsonValue.IsString()) // Object is String { - const types::String jsonValueString = aJsonValue.GetString(); + const type::String jsonValueString = aJsonValue.GetString(); return Object::String(jsonValueString); } else if (aJsonValue.IsObject()) // Object is Object { - ctnr::Dictionary dictionary = ctnr::Dictionary::Empty(); + container::Dictionary dictionary = container::Dictionary::Empty(); for (const auto& objectIt : aJsonValue.GetObject()) { @@ -920,7 +920,7 @@ Object Object::ParseJson(const types::String& aString) return Object::Array(); } - ctnr::Array array = ctnr::Array::Empty(); + container::Array array = container::Array::Empty(); for (const auto& arrayElement : aJsonValue.GetArray()) { @@ -952,7 +952,7 @@ Object Object::ParseJson(const types::String& aString) return object; } -Object Object::ParseYaml(const types::String& aString) +Object Object::ParseYaml(const type::String& aString) { LOG_SCOPE("Object", "ParseYaml"); @@ -1005,7 +1005,7 @@ Object Object::ParseYaml(const types::String& aString) case YAML::NodeType::Sequence: { - ctnr::Array array = ctnr::Array::Empty(); + container::Array array = container::Array::Empty(); for (const auto& node : aNode) { @@ -1017,7 +1017,7 @@ Object Object::ParseYaml(const types::String& aString) case YAML::NodeType::Map: { - ctnr::Dictionary dictionary = ctnr::Dictionary::Empty(); + container::Dictionary dictionary = container::Dictionary::Empty(); for (const auto& node : aNode) { @@ -1065,7 +1065,7 @@ Object Object::Load(const filesystem::File& aFile, const Object::Format& aFormat return Object::Parse(aFile.getContents(), aFormat); } -types::String Object::StringFromType(const Object::Type& aType) +type::String Object::StringFromType(const Object::Type& aType) { LOG_SCOPE("Object", "StringFromType"); @@ -1097,10 +1097,10 @@ types::String Object::StringFromType(const Object::Type& aType) break; } - return types::String::Empty(); + return type::String::Empty(); } -Object::Type Object::TypeFromString(const types::String& aString) +Object::Type Object::TypeFromString(const type::String& aString) { LOG_SCOPE("Object", "TypeFromString"); @@ -1149,6 +1149,6 @@ Object::Object(const Unique& anObjectImpl) { } -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/src/OpenSpaceToolkit/Core/Containers/Table.cpp b/src/OpenSpaceToolkit/Core/Container/Table.cpp similarity index 97% rename from src/OpenSpaceToolkit/Core/Containers/Table.cpp rename to src/OpenSpaceToolkit/Core/Container/Table.cpp index e1a115e7..fb3c6607 100644 --- a/src/OpenSpaceToolkit/Core/Containers/Table.cpp +++ b/src/OpenSpaceToolkit/Core/Container/Table.cpp @@ -1,8 +1,8 @@ /// Apache License 2.0 -#include +#include #include -#include +#include // #include #include @@ -11,7 +11,7 @@ namespace ostk { namespace core { -namespace ctnr +namespace container { Table::Table(const Array& aHeader, const Array& aRowArray) @@ -289,8 +289,8 @@ Table Table::Load(const File& aFile, const Table::Format& aFormat, bool hasHeade Table Table::LoadCsv(const File& aFile, bool hasHeader) { - using ostk::core::types::Integer; - using ostk::core::types::Real; + using ostk::core::type::Integer; + using ostk::core::type::Real; try { @@ -380,6 +380,6 @@ Table Table::LoadCsv(const File& aFile, bool hasHeader) return Table::Empty(); } -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/src/OpenSpaceToolkit/Core/Containers/Table/Row.cpp b/src/OpenSpaceToolkit/Core/Container/Table/Row.cpp similarity index 91% rename from src/OpenSpaceToolkit/Core/Containers/Table/Row.cpp rename to src/OpenSpaceToolkit/Core/Container/Table/Row.cpp index 986f90bc..1be0a53e 100644 --- a/src/OpenSpaceToolkit/Core/Containers/Table/Row.cpp +++ b/src/OpenSpaceToolkit/Core/Container/Table/Row.cpp @@ -1,15 +1,15 @@ /// Apache License 2.0 -#include -#include +#include +#include #include -#include +#include namespace ostk { namespace core { -namespace ctnr +namespace container { namespace table { @@ -123,6 +123,6 @@ void Row::associateTable(const Table* aTablePtr) } } // namespace table -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/src/OpenSpaceToolkit/Core/Containers/Triple.tpp b/src/OpenSpaceToolkit/Core/Container/Triple.tpp similarity index 89% rename from src/OpenSpaceToolkit/Core/Containers/Triple.tpp rename to src/OpenSpaceToolkit/Core/Container/Triple.tpp index d2444ea5..00c01b97 100644 --- a/src/OpenSpaceToolkit/Core/Containers/Triple.tpp +++ b/src/OpenSpaceToolkit/Core/Container/Triple.tpp @@ -4,7 +4,7 @@ namespace ostk { namespace core { -namespace ctnr +namespace container { template @@ -19,6 +19,6 @@ Triple make_triple(const T& aFirstElement, const U& aSecondElement, con return triple; } -} // namespace ctnr +} // namespace container } // namespace core } // namespace ostk diff --git a/src/OpenSpaceToolkit/Core/FileSystem/Directory.cpp b/src/OpenSpaceToolkit/Core/FileSystem/Directory.cpp index 9cadef2d..23097183 100644 --- a/src/OpenSpaceToolkit/Core/FileSystem/Directory.cpp +++ b/src/OpenSpaceToolkit/Core/FileSystem/Directory.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include namespace ostk { @@ -177,19 +177,19 @@ Directory Directory::getParentDirectory() const return File::Path(path_).getParentDirectory(); } -// ctnr::Array Directory::getFiles ( ) const +// container::Array Directory::getFiles ( ) const // { // } -ctnr::Array Directory::getDirectories() const +container::Array Directory::getDirectories() const { if (!this->exists()) { throw ostk::core::error::RuntimeError("Directory [{}] does not exist.", this->toString()); } - ctnr::Array subDirectories = ctnr::Array::Empty(); + container::Array subDirectories = container::Array::Empty(); try { diff --git a/src/OpenSpaceToolkit/Core/FileSystem/File.cpp b/src/OpenSpaceToolkit/Core/FileSystem/File.cpp index a014770c..e155968e 100644 --- a/src/OpenSpaceToolkit/Core/FileSystem/File.cpp +++ b/src/OpenSpaceToolkit/Core/FileSystem/File.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include namespace ostk { diff --git a/src/OpenSpaceToolkit/Core/FileSystem/Path.cpp b/src/OpenSpaceToolkit/Core/FileSystem/Path.cpp index baf5c3b2..6886d4ab 100644 --- a/src/OpenSpaceToolkit/Core/FileSystem/Path.cpp +++ b/src/OpenSpaceToolkit/Core/FileSystem/Path.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include namespace ostk { @@ -285,7 +285,7 @@ Path Path::Parse(const String& aString) } // Path Path::Strings ( const -// std::initializer_list aStringList ) +// std::initializer_list aStringList ) // { // } diff --git a/src/OpenSpaceToolkit/Core/FileSystem/PermissionSet.cpp b/src/OpenSpaceToolkit/Core/FileSystem/PermissionSet.cpp index dc4a887b..45f14e09 100644 --- a/src/OpenSpaceToolkit/Core/FileSystem/PermissionSet.cpp +++ b/src/OpenSpaceToolkit/Core/FileSystem/PermissionSet.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include namespace ostk { diff --git a/src/OpenSpaceToolkit/Core/Types/Integer.cpp b/src/OpenSpaceToolkit/Core/Type/Integer.cpp similarity index 93% rename from src/OpenSpaceToolkit/Core/Types/Integer.cpp rename to src/OpenSpaceToolkit/Core/Type/Integer.cpp index bd86e70a..6a52ad0d 100644 --- a/src/OpenSpaceToolkit/Core/Types/Integer.cpp +++ b/src/OpenSpaceToolkit/Core/Type/Integer.cpp @@ -6,13 +6,13 @@ #include #include -#include +#include namespace ostk { namespace core { -namespace types +namespace type { Integer::Integer(Integer::ValueType anInteger) @@ -704,12 +704,12 @@ std::ostream& operator<<(std::ostream& anOutputStream, const Integer& anInteger) break; } - // ostk::core::utilities::Output::Header(anOutputStream, "Integer") ; + // ostk::core::utility::Output::Header(anOutputStream, "Integer") ; - // ostk::core::utilities::Output::Line(anOutputStream) << "Type:" << anInteger.type_ ; - // ostk::core::utilities::Output::Line(anOutputStream) << "Value:" << anInteger.value_ ; + // ostk::core::utility::Output::Line(anOutputStream) << "Type:" << anInteger.type_ ; + // ostk::core::utility::Output::Line(anOutputStream) << "Value:" << anInteger.value_ ; - // ostk::core::utilities::Output::Footer(anOutputStream) ; + // ostk::core::utility::Output::Footer(anOutputStream) ; return anOutputStream; } @@ -774,41 +774,41 @@ bool Integer::isOdd() const return this->isFinite() && (value_ % 2 != 0); } -types::Sign Integer::getSign() const +type::Sign Integer::getSign() const { switch (type_) { case Integer::Type::Undefined: - return types::Sign::Undefined; + return type::Sign::Undefined; case Integer::Type::Defined: { if (value_ > 0) { - return types::Sign::Positive; + return type::Sign::Positive; } else if (value_ < 0) { - return types::Sign::Negative; + return type::Sign::Negative; } - return types::Sign::None; + return type::Sign::None; } case Integer::Type::PositiveInfinity: - return types::Sign::Positive; + return type::Sign::Positive; case Integer::Type::NegativeInfinity: - return types::Sign::Negative; + return type::Sign::Negative; default: - return types::Sign::Undefined; + return type::Sign::Undefined; } - return types::Sign::Undefined; + return type::Sign::Undefined; } -types::String Integer::toString() const +type::String Integer::toString() const { switch (type_) { @@ -825,7 +825,7 @@ types::String Integer::toString() const return "-Inf"; } - return types::String::Empty(); + return type::String::Empty(); } Integer Integer::Undefined() @@ -848,25 +848,25 @@ Integer Integer::NegativeInfinity() return Integer(Integer::Type::NegativeInfinity, std::numeric_limits::min()); } -Integer Integer::Int8(types::Int8 anInteger) +Integer Integer::Int8(type::Int8 anInteger) { return Integer(Integer::Type::Defined, static_cast(anInteger)); } -Integer Integer::Int16(types::Int16 anInteger) +Integer Integer::Int16(type::Int16 anInteger) { return Integer(Integer::Type::Defined, static_cast(anInteger)); } -Integer Integer::Int32(types::Int32 anInteger) +Integer Integer::Int32(type::Int32 anInteger) { return Integer(Integer::Type::Defined, static_cast(anInteger)); } -Integer Integer::Int64(types::Int64 anInteger) +Integer Integer::Int64(type::Int64 anInteger) { - if ((anInteger < static_cast(std::numeric_limits::min())) || - (anInteger > static_cast(std::numeric_limits::max()))) + if ((anInteger < static_cast(std::numeric_limits::min())) || + (anInteger > static_cast(std::numeric_limits::max()))) { throw ostk::core::error::RuntimeError( "Int64 value [" + boost::lexical_cast(anInteger) + "] is out of Integer supported range [" + @@ -878,19 +878,19 @@ Integer Integer::Int64(types::Int64 anInteger) return Integer(Integer::Type::Defined, static_cast(anInteger)); } -Integer Integer::Uint8(types::Uint8 anInteger) +Integer Integer::Uint8(type::Uint8 anInteger) { return Integer(Integer::Type::Defined, static_cast(anInteger)); } -Integer Integer::Uint16(types::Uint16 anInteger) +Integer Integer::Uint16(type::Uint16 anInteger) { return Integer(Integer::Type::Defined, static_cast(anInteger)); } -Integer Integer::Uint32(types::Uint32 anInteger) +Integer Integer::Uint32(type::Uint32 anInteger) { - if (anInteger > static_cast(std::numeric_limits::max())) + if (anInteger > static_cast(std::numeric_limits::max())) { throw ostk::core::error::RuntimeError( "Uint32 value [" + boost::lexical_cast(anInteger) + "] is out of Integer supported range [" + @@ -902,9 +902,9 @@ Integer Integer::Uint32(types::Uint32 anInteger) return Integer(Integer::Type::Defined, static_cast(anInteger)); } -Integer Integer::Uint64(types::Uint64 anInteger) +Integer Integer::Uint64(type::Uint64 anInteger) { - if (anInteger > static_cast(std::numeric_limits::max())) + if (anInteger > static_cast(std::numeric_limits::max())) { throw ostk::core::error::RuntimeError( "Uint64 value [" + boost::lexical_cast(anInteger) + "] is out of Integer supported range [" + @@ -916,7 +916,7 @@ Integer Integer::Uint64(types::Uint64 anInteger) return Integer(Integer::Type::Defined, static_cast(anInteger)); } -Integer Integer::Index(const types::Index& anIndex) +Integer Integer::Index(const type::Index& anIndex) { if (!(anIndex < std::numeric_limits::max())) { @@ -926,7 +926,7 @@ Integer Integer::Index(const types::Index& anIndex) return Integer(Integer::Type::Defined, static_cast(anIndex)); } -Integer Integer::Size(const types::Size& aSize) +Integer Integer::Size(const type::Size& aSize) { if (!(aSize < std::numeric_limits::max())) { @@ -941,7 +941,7 @@ bool Integer::CanParse(char aCharacter) return std::isdigit(aCharacter); } -bool Integer::CanParse(const types::String& aString) +bool Integer::CanParse(const type::String& aString) { if (aString.isEmpty()) { @@ -972,7 +972,7 @@ Integer Integer::Parse(char aCharacter) return Integer::Undefined(); } -Integer Integer::Parse(const types::String& aString) +Integer Integer::Parse(const type::String& aString) { if (aString.isEmpty()) { @@ -1012,6 +1012,6 @@ Integer::Integer(const Integer::Type& aType, const Integer::ValueType& anInteger { } -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/src/OpenSpaceToolkit/Core/Types/Real.cpp b/src/OpenSpaceToolkit/Core/Type/Real.cpp similarity index 91% rename from src/OpenSpaceToolkit/Core/Types/Real.cpp rename to src/OpenSpaceToolkit/Core/Type/Real.cpp index 463d8a73..c2cfe14b 100644 --- a/src/OpenSpaceToolkit/Core/Types/Real.cpp +++ b/src/OpenSpaceToolkit/Core/Type/Real.cpp @@ -7,13 +7,13 @@ #include #include -#include +#include namespace ostk { namespace core { -namespace types +namespace type { Real::Real(Real::ValueType aReal) @@ -517,12 +517,12 @@ std::ostream& operator<<(std::ostream& anOutputStream, const Real& aReal) break; } - // ostk::core::utilities::Output::Header(anOutputStream, "Real") ; + // ostk::core::utility::Output::Header(anOutputStream, "Real") ; - // ostk::core::utilities::Output::Line(anOutputStream) << "Type:" << aReal.type_ ; - // ostk::core::utilities::Output::Line(anOutputStream) << "Value:" << aReal.value_ ; + // ostk::core::utility::Output::Line(anOutputStream) << "Type:" << aReal.type_ ; + // ostk::core::utility::Output::Line(anOutputStream) << "Value:" << aReal.value_ ; - // ostk::core::utilities::Output::Footer(anOutputStream) ; + // ostk::core::utility::Output::Footer(anOutputStream) ; return anOutputStream; } @@ -614,41 +614,41 @@ bool Real::isNear(const Real& aValue, const Real& aTolerance) const return ((*this) - aValue).abs() <= aTolerance; } -types::Sign Real::getSign() const +type::Sign Real::getSign() const { switch (type_) { case Real::Type::Undefined: - return types::Sign::Undefined; + return type::Sign::Undefined; case Real::Type::Defined: { if (value_ > 0.0) { - return types::Sign::Positive; + return type::Sign::Positive; } else if (value_ < 0.0) { - return types::Sign::Negative; + return type::Sign::Negative; } - return types::Sign::None; + return type::Sign::None; } case Real::Type::PositiveInfinity: - return types::Sign::Positive; + return type::Sign::Positive; case Real::Type::NegativeInfinity: - return types::Sign::Negative; + return type::Sign::Negative; default: - return types::Sign::Undefined; + return type::Sign::Undefined; } - return types::Sign::Undefined; + return type::Sign::Undefined; } -types::String Real::toString(const types::Integer& aPrecision) const +type::String Real::toString(const type::Integer& aPrecision) const { switch (type_) { @@ -661,7 +661,7 @@ types::String Real::toString(const types::Integer& aPrecision) const { if (this->isInteger()) { - types::String realString = boost::lexical_cast(value_); + type::String realString = boost::lexical_cast(value_); if (realString.find('e') == std::string::npos) { @@ -671,8 +671,8 @@ types::String Real::toString(const types::Integer& aPrecision) const return realString; } - // types::String realString = std::to_string(value_) ; - types::String realString = boost::lexical_cast(value_); + // type::String realString = std::to_string(value_) ; + type::String realString = boost::lexical_cast(value_); // std::ostringstream stringStream ; @@ -680,7 +680,7 @@ types::String Real::toString(const types::Integer& aPrecision) const // stringStream << std::fixed << value_ ; - // types::String realString = stringStream.str() ; + // type::String realString = stringStream.str() ; if (realString.find('e') == std::string::npos) { @@ -711,19 +711,19 @@ types::String Real::toString(const types::Integer& aPrecision) const return "-Inf"; } - return types::String::Empty(); + return type::String::Empty(); } -types::Integer Real::toInteger() const +type::Integer Real::toInteger() const { if (this->isInteger()) { - return types::Integer(static_cast(value_)); + return type::Integer(static_cast(value_)); } throw ostk::core::error::RuntimeError("Real is not integer."); - return types::Integer::Undefined(); + return type::Integer::Undefined(); } Real Real::abs() const @@ -748,26 +748,26 @@ Real Real::abs() const return Real::Undefined(); } -types::Integer Real::floor() const +type::Integer Real::floor() const { switch (type_) { case Real::Type::Undefined: - return types::Integer::Undefined(); + return type::Integer::Undefined(); case Real::Type::Defined: - return types::Integer(static_cast(std::floor(value_))); + return type::Integer(static_cast(std::floor(value_))); case Real::Type::PositiveInfinity: case Real::Type::NegativeInfinity: - return types::Integer::Undefined(); + return type::Integer::Undefined(); default: throw ostk::core::error::runtime::Undefined("Type"); break; } - return types::Integer::Undefined(); + return type::Integer::Undefined(); } Real Real::sqrt() const @@ -841,7 +841,7 @@ Real Real::NegativeInfinity() return Real(Real::Type::NegativeInfinity, std::numeric_limits::lowest()); } -Real Real::Integer(const types::Integer& anInteger) +Real Real::Integer(const type::Integer& anInteger) { if (anInteger.isDefined()) { @@ -851,7 +851,7 @@ Real Real::Integer(const types::Integer& anInteger) return Real::Undefined(); } -Real Real::CanParse(const types::String& aString) +Real Real::CanParse(const type::String& aString) { if (aString.isEmpty()) { @@ -869,7 +869,7 @@ Real Real::CanParse(const types::String& aString) return boost::conversion::try_lexical_convert(aString, real); } -Real Real::Parse(const types::String& aString) +Real Real::Parse(const type::String& aString) { if (aString.isEmpty()) { @@ -910,7 +910,7 @@ Real Real::Parse(const types::String& aString) return Real::Undefined(); } -// Real Real::Object ( const ctnr::Object& anObject ) +// Real Real::Object ( const container::Object& anObject ) // { // } @@ -921,6 +921,6 @@ Real::Real(const Real::Type& aType, const Real::ValueType& aReal) { } -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/src/OpenSpaceToolkit/Core/Types/String.cpp b/src/OpenSpaceToolkit/Core/Type/String.cpp similarity index 92% rename from src/OpenSpaceToolkit/Core/Types/String.cpp rename to src/OpenSpaceToolkit/Core/Type/String.cpp index c6112f0b..cb61d3e8 100644 --- a/src/OpenSpaceToolkit/Core/Types/String.cpp +++ b/src/OpenSpaceToolkit/Core/Type/String.cpp @@ -2,19 +2,19 @@ #include -#include +#include #include -#include -#include +#include +#include namespace ostk { namespace core { -namespace types +namespace type { -using ostk::core::types::Integer; +using ostk::core::type::Integer; String::String() : std::string() @@ -286,6 +286,6 @@ String String::SanitizeUTF8(const String& string) return result; } -} // namespace types +} // namespace type } // namespace core } // namespace ostk diff --git a/src/OpenSpaceToolkit/Core/Utilities/Print.cpp b/src/OpenSpaceToolkit/Core/Utility/Print.cpp similarity index 64% rename from src/OpenSpaceToolkit/Core/Utilities/Print.cpp rename to src/OpenSpaceToolkit/Core/Utility/Print.cpp index c0854f02..1b820bfc 100644 --- a/src/OpenSpaceToolkit/Core/Utilities/Print.cpp +++ b/src/OpenSpaceToolkit/Core/Utility/Print.cpp @@ -1,6 +1,6 @@ /// Apache License 2.0 -#include +#include #define LENGTH 100 @@ -15,7 +15,7 @@ Print::LineBuffer::LineBuffer(std::ostream& anOutputStream, uint anIndentation) : stream_(anOutputStream), indentation_(anIndentation) { - stream_ << std::left << types::String::Replicate(" ", indentation_); + stream_ << std::left << type::String::Replicate(" ", indentation_); } Print::LineBuffer::~LineBuffer() @@ -23,10 +23,10 @@ Print::LineBuffer::~LineBuffer() stream_ << std::endl; } -void Print::Header(std::ostream& anOutputStream, const types::String& aName) +void Print::Header(std::ostream& anOutputStream, const type::String& aName) { anOutputStream << "-- " << aName << " " - << types::String::Replicate( + << type::String::Replicate( '-', (aName.getLength() < (LENGTH - 3)) ? ((LENGTH - 3) - aName.getLength() - 1) : 0 ) << std::endl; @@ -37,16 +37,16 @@ Print::LineBuffer Print::Line(std::ostream& anOutputStream, uint anIndentation) return Print::LineBuffer(anOutputStream, anIndentation); } -void Print::Separator(std::ostream& anOutputStream, const types::String& aName) +void Print::Separator(std::ostream& anOutputStream, const type::String& aName) { if (aName.isEmpty()) { - anOutputStream << types::String::Replicate("- ", LENGTH / 2) << std::endl; + anOutputStream << type::String::Replicate("- ", LENGTH / 2) << std::endl; } else { anOutputStream << " " << aName << " " - << types::String::Replicate( + << type::String::Replicate( "- ", (aName.getLength() < (LENGTH - 4)) ? ((LENGTH - 4) - aName.getLength() - 1) / 2 : 0 ) << std::endl; @@ -55,7 +55,7 @@ void Print::Separator(std::ostream& anOutputStream, const types::String& aName) void Print::Footer(std::ostream& anOutputStream) { - anOutputStream << types::String::Replicate('-', LENGTH) << std::endl; + anOutputStream << type::String::Replicate('-', LENGTH) << std::endl; } } // namespace utils diff --git a/test/OpenSpaceToolkit/Core/Containers/Array.test.cpp b/test/OpenSpaceToolkit/Core/Container/Array.test.cpp similarity index 73% rename from test/OpenSpaceToolkit/Core/Containers/Array.test.cpp rename to test/OpenSpaceToolkit/Core/Container/Array.test.cpp index 030eb8fb..6724e2db 100644 --- a/test/OpenSpaceToolkit/Core/Containers/Array.test.cpp +++ b/test/OpenSpaceToolkit/Core/Container/Array.test.cpp @@ -1,20 +1,20 @@ /// Apache License 2.0 -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -TEST(OpenSpaceToolkit_Core_Containers_Array, VectorConstructor) +TEST(OpenSpaceToolkit_Core_Container_Array, VectorConstructor) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const std::vector aVector = {1, 2, 3}; @@ -45,12 +45,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, VectorConstructor) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, SizeValueConstructor) +TEST(OpenSpaceToolkit_Core_Container_Array, SizeValueConstructor) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const Size size = 3; @@ -83,12 +83,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, SizeValueConstructor) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, InitializerListConstructor) +TEST(OpenSpaceToolkit_Core_Container_Array, InitializerListConstructor) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { EXPECT_NO_THROW(Array array({1, 2, 3}); (void)array;); @@ -115,10 +115,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, InitializerListConstructor) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, AdditionOperator) +TEST(OpenSpaceToolkit_Core_Container_Array, AdditionOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Array; { const Array firstArray({-4, -3, -2, -1}); @@ -130,11 +130,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, AdditionOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, IsEmpty) +TEST(OpenSpaceToolkit_Core_Container_Array, IsEmpty) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::container::Array; { EXPECT_FALSE(Array({1, 2, 3}).isEmpty()); @@ -146,11 +146,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, IsEmpty) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, Contains) +TEST(OpenSpaceToolkit_Core_Container_Array, Contains) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const Array array({1, 2, 3}); @@ -174,10 +174,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, Contains) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, IsNear) +TEST(OpenSpaceToolkit_Core_Container_Array, IsNear) { - using ostk::core::types::Real; - using ostk::core::ctnr::Array; + using ostk::core::type::Real; + using ostk::core::container::Array; // Tolerance @@ -224,11 +224,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, IsNear) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, AccessFirst) +TEST(OpenSpaceToolkit_Core_Container_Array, AccessFirst) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const Array array({1, 2, 3}); @@ -253,11 +253,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, AccessFirst) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, AccessLast) +TEST(OpenSpaceToolkit_Core_Container_Array, AccessLast) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const Array array({1, 2, 3}); @@ -282,12 +282,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, AccessLast) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, GetSize) +TEST(OpenSpaceToolkit_Core_Container_Array, GetSize) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; EXPECT_EQ(Size(0), Array({}).getSize()); EXPECT_EQ(Size(0), Array::Empty().getSize()); @@ -296,12 +296,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, GetSize) EXPECT_EQ(Size(2), Array({"abc", "def"}).getSize()); } -TEST(OpenSpaceToolkit_Core_Containers_Array, GetIndexOf) +TEST(OpenSpaceToolkit_Core_Container_Array, GetIndexOf) { - using ostk::core::types::Index; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Index; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const Array array({1, 2, 3}); @@ -325,11 +325,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, GetIndexOf) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, ToString) +TEST(OpenSpaceToolkit_Core_Container_Array, ToString) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const Array array({1, 2, 3}); @@ -349,21 +349,21 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, ToString) } } -// TEST (OpenSpaceToolkit_Core_Containers_Array, GetObject) +// TEST (OpenSpaceToolkit_Core_Container_Array, GetObject) // { -// using ostk::core::ctnr::Array ; +// using ostk::core::container::Array ; // FAIL() ; // } -TEST(OpenSpaceToolkit_Core_Containers_Array, AccessWhere) +TEST(OpenSpaceToolkit_Core_Container_Array, AccessWhere) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const Array array({-4, -3, -2, -1, +0, +1, +2, +3, +4}); @@ -387,12 +387,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, AccessWhere) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, GetWhere) +TEST(OpenSpaceToolkit_Core_Container_Array, GetWhere) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const Array array({-4, -3, -2, -1, +0, +1, +2, +3, +4}); @@ -418,11 +418,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, GetWhere) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, Find) +TEST(OpenSpaceToolkit_Core_Container_Array, Find) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::container::Array; { const Array array({-4, -3, -2, -1, +0, +1, +2, +3, +4}); @@ -467,11 +467,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, Find) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, Map) +TEST(OpenSpaceToolkit_Core_Container_Array, Map) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { const Array strings = {"1", "2", "3"}; @@ -502,10 +502,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, Map) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, Reduce) +TEST(OpenSpaceToolkit_Core_Container_Array, Reduce) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Array; { const Array integers = {1, 2, 3}; @@ -533,12 +533,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, Reduce) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, Add) +TEST(OpenSpaceToolkit_Core_Container_Array, Add) { - using ostk::core::types::Index; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Index; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { Array array({1, 2, 3}); @@ -569,12 +569,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, Add) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, Remove) +TEST(OpenSpaceToolkit_Core_Container_Array, Remove) { - using ostk::core::types::Index; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Index; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { Array array({1, 2, 3}); @@ -615,12 +615,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, Remove) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, MergeWith) +TEST(OpenSpaceToolkit_Core_Container_Array, MergeWith) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { Array firstArray({-4, -3, -2, -1}); @@ -659,12 +659,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, MergeWith) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, RemoveWhere) +TEST(OpenSpaceToolkit_Core_Container_Array, RemoveWhere) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Array; { Array array({-4, -3, -2, -1, +0, +1, +2, +3, +4}); @@ -680,11 +680,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, RemoveWhere) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, Empty) +TEST(OpenSpaceToolkit_Core_Container_Array, Empty) { - using ostk::core::types::Size; - using ostk::core::types::Integer; - using ostk::core::ctnr::Array; + using ostk::core::type::Size; + using ostk::core::type::Integer; + using ostk::core::container::Array; { EXPECT_NO_THROW(Array array = Array::Empty(); (void)array;); @@ -693,11 +693,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, Empty) } } -TEST(OpenSpaceToolkit_Core_Containers_Array, Zip) +TEST(OpenSpaceToolkit_Core_Container_Array, Zip) { - using ostk::core::types::Index; - using ostk::core::types::Integer; - using ostk::core::ctnr::Array; + using ostk::core::type::Index; + using ostk::core::type::Integer; + using ostk::core::container::Array; { const Array firstArray = {{-4, -3, -2, -1, +0, +1, +2, +3, +4}}; @@ -705,7 +705,7 @@ TEST(OpenSpaceToolkit_Core_Containers_Array, Zip) Index index = 0; - for (const auto tuple : ostk::core::ctnr::iterators::Zip(firstArray, secondArray)) + for (const auto tuple : ostk::core::container::iterator::Zip(firstArray, secondArray)) { EXPECT_EQ(std::get<0>(tuple) * 2, std::get<1>(tuple)); diff --git a/test/OpenSpaceToolkit/Core/Containers/Dictionary.test.cpp b/test/OpenSpaceToolkit/Core/Container/Dictionary.test.cpp similarity index 89% rename from test/OpenSpaceToolkit/Core/Containers/Dictionary.test.cpp rename to test/OpenSpaceToolkit/Core/Container/Dictionary.test.cpp index 2d243b6c..60fc6f70 100644 --- a/test/OpenSpaceToolkit/Core/Containers/Dictionary.test.cpp +++ b/test/OpenSpaceToolkit/Core/Container/Dictionary.test.cpp @@ -1,19 +1,19 @@ /// Apache License 2.0 -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, InitializerListConstructor) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, InitializerListConstructor) { - using ostk::core::types::Size; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::type::Size; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { const Dictionary dictionary = { @@ -91,10 +91,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, InitializerListConstructor) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, CopyConstructor) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, CopyConstructor) { - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { const Dictionary firstDictionary = { @@ -118,10 +118,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, CopyConstructor) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, AssignmentOperator) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, AssignmentOperator) { - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { const Dictionary firstDictionary = { @@ -145,10 +145,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, AssignmentOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, EqualToOperator) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, EqualToOperator) { - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { const Dictionary firstDictionary = { @@ -203,10 +203,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, EqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, NotEqualToOperator) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, NotEqualToOperator) { - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { const Dictionary firstDictionary = { @@ -261,10 +261,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, NotEqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, KeySubscriptOperator) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, KeySubscriptOperator) { - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { const Dictionary dictionary = { @@ -296,10 +296,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, KeySubscriptOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, Iterators) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, Iterator) { - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { const Dictionary dictionary = { @@ -451,10 +451,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, Iterators) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, IsEmpty) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, IsEmpty) { - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { EXPECT_FALSE(Dictionary({{"Key", Object::String("Value")}}).isEmpty()); @@ -465,10 +465,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, IsEmpty) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, HasValueForKey) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, HasValueForKey) { - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { Dictionary dictionary = Dictionary::Empty(); @@ -481,11 +481,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, HasValueForKey) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, GetSize) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, GetSize) { - using ostk::core::types::Size; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::type::Size; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { EXPECT_EQ(Size(0), Dictionary::Empty().getSize()); @@ -522,10 +522,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, GetSize) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, AddValueForKey) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, AddValueForKey) { - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { Dictionary dictionary = Dictionary::Empty(); @@ -542,20 +542,20 @@ TEST(OpenSpaceToolkit_Core_Containers_Dictionary, AddValueForKey) } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, Empty) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, Empty) { - using ostk::core::ctnr::Dictionary; + using ostk::core::container::Dictionary; { EXPECT_TRUE(Dictionary::Empty().isEmpty()); } } -TEST(OpenSpaceToolkit_Core_Containers_Dictionary, Parse) +TEST(OpenSpaceToolkit_Core_Container_Dictionary, Parse) { - using ostk::core::types::String; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Dictionary; + using ostk::core::type::String; + using ostk::core::container::Object; + using ostk::core::container::Dictionary; { String jsonString = "{}"; diff --git a/test/OpenSpaceToolkit/Core/Containers/Object.test.cpp b/test/OpenSpaceToolkit/Core/Container/Object.test.cpp similarity index 82% rename from test/OpenSpaceToolkit/Core/Containers/Object.test.cpp rename to test/OpenSpaceToolkit/Core/Container/Object.test.cpp index b252dbc4..0f5715df 100644 --- a/test/OpenSpaceToolkit/Core/Containers/Object.test.cpp +++ b/test/OpenSpaceToolkit/Core/Container/Object.test.cpp @@ -1,19 +1,19 @@ /// Apache License 2.0 -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include #include -TEST(OpenSpaceToolkit_Core_Containers_Object, InitializerListConstructor) +TEST(OpenSpaceToolkit_Core_Container_Object, InitializerListConstructor) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; { Object object = { @@ -40,12 +40,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, InitializerListConstructor) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, CopyConstructor) +TEST(OpenSpaceToolkit_Core_Container_Object, CopyConstructor) { - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; - using ostk::core::ctnr::Object; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; + using ostk::core::container::Object; { Object firstObject = Object::Integer(123); @@ -58,12 +58,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, CopyConstructor) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, AssignmentOperator) +TEST(OpenSpaceToolkit_Core_Container_Object, AssignmentOperator) { - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; - using ostk::core::ctnr::Object; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; + using ostk::core::container::Object; { Object firstObject = Object::Integer(123); @@ -85,12 +85,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, AssignmentOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, EqualToOperator) +TEST(OpenSpaceToolkit_Core_Container_Object, EqualToOperator) { - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; - using ostk::core::ctnr::Object; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; + using ostk::core::container::Object; { EXPECT_TRUE(Object::Integer(123) == Object::Integer(123)); @@ -109,12 +109,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, EqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, NotEqualToOperator) +TEST(OpenSpaceToolkit_Core_Container_Object, NotEqualToOperator) { - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; - using ostk::core::ctnr::Object; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; + using ostk::core::container::Object; { EXPECT_FALSE(Object::Integer(123) != Object::Integer(123)); @@ -133,10 +133,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, NotEqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, KeySubscriptOperator) +TEST(OpenSpaceToolkit_Core_Container_Object, KeySubscriptOperator) { - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Object; + using ostk::core::container::Dictionary; + using ostk::core::container::Object; { Dictionary dictionary = {{"Key", Object::String("Value")}}; @@ -147,10 +147,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, KeySubscriptOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, IndexSubscriptOperator) +TEST(OpenSpaceToolkit_Core_Container_Object, IndexSubscriptOperator) { - using ostk::core::types::Size; - using ostk::core::ctnr::Object; + using ostk::core::type::Size; + using ostk::core::container::Object; { Object object = Object::Array(); @@ -189,9 +189,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, IndexSubscriptOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, StreamOperator) +TEST(OpenSpaceToolkit_Core_Container_Object, StreamOperator) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; { Object object = Object::Undefined(); @@ -208,9 +208,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, StreamOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, OutputFileStreamOperator) +TEST(OpenSpaceToolkit_Core_Container_Object, OutputFileStreamOperator) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; using ostk::core::filesystem::Path; using ostk::core::filesystem::File; @@ -250,9 +250,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, OutputFileStreamOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, InputFileStreamOperator) +TEST(OpenSpaceToolkit_Core_Container_Object, InputFileStreamOperator) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; using ostk::core::filesystem::Path; using ostk::core::filesystem::File; @@ -287,14 +287,14 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, InputFileStreamOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, IsDefined) +TEST(OpenSpaceToolkit_Core_Container_Object, IsDefined) { - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; + using ostk::core::container::Dictionary; + using ostk::core::container::Array; + using ostk::core::container::Object; { EXPECT_TRUE(Object::Integer(123).isDefined()); @@ -309,11 +309,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, IsDefined) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, IsBoolean) +TEST(OpenSpaceToolkit_Core_Container_Object, IsBoolean) { - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::container::Dictionary; + using ostk::core::container::Array; + using ostk::core::container::Object; EXPECT_TRUE(Object::Boolean(true).isBoolean()); EXPECT_TRUE(Object::Boolean(false).isBoolean()); @@ -326,12 +326,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, IsBoolean) EXPECT_FALSE(Object::Array().isBoolean()); } -TEST(OpenSpaceToolkit_Core_Containers_Object, IsInteger) +TEST(OpenSpaceToolkit_Core_Container_Object, IsInteger) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::type::Integer; + using ostk::core::container::Dictionary; + using ostk::core::container::Array; + using ostk::core::container::Object; EXPECT_TRUE(Object::Integer(123).isInteger()); @@ -343,12 +343,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, IsInteger) EXPECT_FALSE(Object::Array().isInteger()); } -TEST(OpenSpaceToolkit_Core_Containers_Object, IsReal) +TEST(OpenSpaceToolkit_Core_Container_Object, IsReal) { - using ostk::core::types::Real; - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::type::Real; + using ostk::core::container::Dictionary; + using ostk::core::container::Array; + using ostk::core::container::Object; EXPECT_TRUE(Object::Real(123.456).isReal()); @@ -360,12 +360,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, IsReal) EXPECT_FALSE(Object::Array().isReal()); } -TEST(OpenSpaceToolkit_Core_Containers_Object, IsString) +TEST(OpenSpaceToolkit_Core_Container_Object, IsString) { - using ostk::core::types::String; - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::type::String; + using ostk::core::container::Dictionary; + using ostk::core::container::Array; + using ostk::core::container::Object; EXPECT_TRUE(Object::String("abc").isString()); EXPECT_TRUE(Object::String("123").isString()); @@ -378,12 +378,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, IsString) EXPECT_FALSE(Object::Array().isString()); } -TEST(OpenSpaceToolkit_Core_Containers_Object, IsDictionary) +TEST(OpenSpaceToolkit_Core_Container_Object, IsDictionary) { - using ostk::core::types::String; - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::type::String; + using ostk::core::container::Dictionary; + using ostk::core::container::Array; + using ostk::core::container::Object; { EXPECT_TRUE(Object::Dictionary(Dictionary::Empty()).isDictionary()); @@ -407,11 +407,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, IsDictionary) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, IsArray) +TEST(OpenSpaceToolkit_Core_Container_Object, IsArray) { - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::container::Dictionary; + using ostk::core::container::Array; + using ostk::core::container::Object; { EXPECT_TRUE(Object::Array().isArray()); @@ -426,9 +426,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, IsArray) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, AccessBoolean) +TEST(OpenSpaceToolkit_Core_Container_Object, AccessBoolean) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; { Object object = Object::Boolean(true); @@ -441,9 +441,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, AccessBoolean) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, AccessInteger) +TEST(OpenSpaceToolkit_Core_Container_Object, AccessInteger) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; { Object object = Object::Integer(123); @@ -456,9 +456,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, AccessInteger) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, AccessReal) +TEST(OpenSpaceToolkit_Core_Container_Object, AccessReal) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; { Object object = Object::Real(123.456); @@ -471,9 +471,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, AccessReal) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, AccessString) +TEST(OpenSpaceToolkit_Core_Container_Object, AccessString) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; { Object object = Object::String("abc"); @@ -486,10 +486,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, AccessString) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, AccessDictionary) +TEST(OpenSpaceToolkit_Core_Container_Object, AccessDictionary) { - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Object; + using ostk::core::container::Dictionary; + using ostk::core::container::Object; { Object object = Object::Dictionary({{"Key", Object::String("Value")}}); @@ -502,10 +502,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, AccessDictionary) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, AccessArray) +TEST(OpenSpaceToolkit_Core_Container_Object, AccessArray) { - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::container::Array; + using ostk::core::container::Object; { Object object = Object::Array({Object::Integer(123), Object::Real(123.456), Object::String("Value")}); @@ -534,12 +534,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, AccessArray) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, GetType) +TEST(OpenSpaceToolkit_Core_Container_Object, GetType) { - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; - using ostk::core::ctnr::Object; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; + using ostk::core::container::Object; { EXPECT_EQ(Object::Type::Undefined, Object::Undefined().getType()); @@ -549,9 +549,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, GetType) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, GetBoolean) +TEST(OpenSpaceToolkit_Core_Container_Object, GetBoolean) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; { Object object = Object::Boolean(true); @@ -572,10 +572,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, GetBoolean) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, GetInteger) +TEST(OpenSpaceToolkit_Core_Container_Object, GetInteger) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Object; + using ostk::core::type::Integer; + using ostk::core::container::Object; { Object object = Object::Integer(123); @@ -596,10 +596,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, GetInteger) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, GetReal) +TEST(OpenSpaceToolkit_Core_Container_Object, GetReal) { - using ostk::core::types::Real; - using ostk::core::ctnr::Object; + using ostk::core::type::Real; + using ostk::core::container::Object; { Object object = Object::Real(123.456); @@ -620,10 +620,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, GetReal) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, GetString) +TEST(OpenSpaceToolkit_Core_Container_Object, GetString) { - using ostk::core::types::String; - using ostk::core::ctnr::Object; + using ostk::core::type::String; + using ostk::core::container::Object; { Object object = Object::String("abc"); @@ -644,11 +644,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, GetString) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, GetDictionary) +TEST(OpenSpaceToolkit_Core_Container_Object, GetDictionary) { - using ostk::core::ctnr::Dictionary; - using ostk::core::types::String; - using ostk::core::ctnr::Object; + using ostk::core::container::Dictionary; + using ostk::core::type::String; + using ostk::core::container::Object; { Dictionary dictionary = Dictionary::Empty(); @@ -668,17 +668,17 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, GetDictionary) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, Undefined) +TEST(OpenSpaceToolkit_Core_Container_Object, Undefined) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; EXPECT_FALSE(Object::Undefined().isDefined()); } -TEST(OpenSpaceToolkit_Core_Containers_Object, Integer) +TEST(OpenSpaceToolkit_Core_Container_Object, Integer) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Object; + using ostk::core::type::Integer; + using ostk::core::container::Object; EXPECT_NO_THROW(Object::Integer(123)); @@ -688,10 +688,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, Integer) EXPECT_EQ(123, object.getInteger()); } -TEST(OpenSpaceToolkit_Core_Containers_Object, Real) +TEST(OpenSpaceToolkit_Core_Container_Object, Real) { - using ostk::core::types::Real; - using ostk::core::ctnr::Object; + using ostk::core::type::Real; + using ostk::core::container::Object; EXPECT_NO_THROW(Object::Real(123.456)); @@ -701,10 +701,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, Real) EXPECT_EQ(123.456, object.getReal()); } -TEST(OpenSpaceToolkit_Core_Containers_Object, String) +TEST(OpenSpaceToolkit_Core_Container_Object, String) { - using ostk::core::types::String; - using ostk::core::ctnr::Object; + using ostk::core::type::String; + using ostk::core::container::Object; EXPECT_NO_THROW(Object::String("abc")); @@ -714,10 +714,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, String) EXPECT_EQ("abc", object.getString()); } -TEST(OpenSpaceToolkit_Core_Containers_Object, Dictionary) +TEST(OpenSpaceToolkit_Core_Container_Object, Dictionary) { - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Object; + using ostk::core::container::Dictionary; + using ostk::core::container::Object; { EXPECT_NO_THROW(Object::Dictionary({{"Key", Object::String("Value")}})); @@ -729,10 +729,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, Dictionary) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, Array) +TEST(OpenSpaceToolkit_Core_Container_Object, Array) { - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::container::Array; + using ostk::core::container::Object; { EXPECT_NO_THROW(Object::Array({Object::Integer(123), Object::Real(123.456), Object::String("Value")})); @@ -746,12 +746,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, Array) } } -TEST(OpenSpaceToolkit_Core_Containers_Object, Parse) +TEST(OpenSpaceToolkit_Core_Container_Object, Parse) { - using ostk::core::types::String; - using ostk::core::ctnr::Dictionary; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; + using ostk::core::type::String; + using ostk::core::container::Dictionary; + using ostk::core::container::Array; + using ostk::core::container::Object; // JSON @@ -1158,10 +1158,10 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, Parse) } } -// TEST (OpenSpaceToolkit_Core_Containers_Object, Load) +// TEST (OpenSpaceToolkit_Core_Container_Object, Load) // { -// using ostk::core::ctnr::Object ; +// using ostk::core::container::Object ; // { @@ -1171,9 +1171,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, Parse) // } -TEST(OpenSpaceToolkit_Core_Containers_Object, StringFromType) +TEST(OpenSpaceToolkit_Core_Container_Object, StringFromType) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; EXPECT_EQ("Undefined", Object::StringFromType(Object::Type::Undefined)); EXPECT_EQ("Boolean", Object::StringFromType(Object::Type::Boolean)); @@ -1184,9 +1184,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Object, StringFromType) EXPECT_EQ("Array", Object::StringFromType(Object::Type::Array)); } -TEST(OpenSpaceToolkit_Core_Containers_Object, TypeFromString) +TEST(OpenSpaceToolkit_Core_Container_Object, TypeFromString) { - using ostk::core::ctnr::Object; + using ostk::core::container::Object; EXPECT_EQ(Object::Type::Undefined, Object::TypeFromString("Undefined")); EXPECT_EQ(Object::Type::Boolean, Object::TypeFromString("Boolean")); diff --git a/test/OpenSpaceToolkit/Core/Container/Pair.test.cpp b/test/OpenSpaceToolkit/Core/Container/Pair.test.cpp new file mode 100644 index 00000000..7931ade3 --- /dev/null +++ b/test/OpenSpaceToolkit/Core/Container/Pair.test.cpp @@ -0,0 +1,72 @@ +/// Apache License 2.0 + +#include +#include +#include + +#include + +TEST(OpenSpaceToolkit_Core_Container_Pair, Constructor) +{ + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Pair; + + { + const Pair pair = {123, "abc"}; + } +} + +TEST(OpenSpaceToolkit_Core_Container_Pair, Getters) +{ + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Pair; + + { + const Pair pair = {123, "abc"}; + + EXPECT_EQ(123, pair.first); + EXPECT_EQ("abc", pair.second); + } +} + +TEST(OpenSpaceToolkit_Core_Container_Pair, Setters) +{ + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Pair; + + { + Pair pair = {123, "abc"}; + + EXPECT_EQ(123, pair.first); + EXPECT_EQ("abc", pair.second); + + pair.first = 456; + pair.second = "def"; + + EXPECT_EQ(456, pair.first); + EXPECT_EQ("def", pair.second); + } +} + +TEST(OpenSpaceToolkit_Core_Container_Pair, Unpack) +{ + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Pair; + using ostk::core::container::Unpack; + + { + const Pair pair = {123, "abc"}; + + Integer integer = Integer::Undefined(); + String string = String::Empty(); + + Unpack(integer, string) = pair; + + EXPECT_EQ(123, integer); + EXPECT_EQ("abc", string); + } +} diff --git a/test/OpenSpaceToolkit/Core/Containers/Table.test.cpp b/test/OpenSpaceToolkit/Core/Container/Table.test.cpp similarity index 78% rename from test/OpenSpaceToolkit/Core/Containers/Table.test.cpp rename to test/OpenSpaceToolkit/Core/Container/Table.test.cpp index 79368e44..7bdd42da 100644 --- a/test/OpenSpaceToolkit/Core/Containers/Table.test.cpp +++ b/test/OpenSpaceToolkit/Core/Container/Table.test.cpp @@ -1,16 +1,16 @@ /// Apache License 2.0 -#include +#include #include -TEST(OpenSpaceToolkit_Core_Containers_Table, Constructor) +TEST(OpenSpaceToolkit_Core_Container_Table, Constructor) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -41,13 +41,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, Constructor) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, CopyConstructor) +TEST(OpenSpaceToolkit_Core_Container_Table, CopyConstructor) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -66,13 +66,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, CopyConstructor) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, CopyAssignmentOperator) +TEST(OpenSpaceToolkit_Core_Container_Table, CopyAssignmentOperator) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -91,13 +91,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, CopyAssignmentOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, EqualToOperator) +TEST(OpenSpaceToolkit_Core_Container_Table, EqualToOperator) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -169,13 +169,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, EqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, NotEqualToOperator) +TEST(OpenSpaceToolkit_Core_Container_Table, NotEqualToOperator) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -247,13 +247,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, NotEqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, SubscriptOperator) +TEST(OpenSpaceToolkit_Core_Container_Table, SubscriptOperator) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -301,13 +301,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, SubscriptOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, FunctionCallOperator) +TEST(OpenSpaceToolkit_Core_Container_Table, FunctionCallOperator) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -358,13 +358,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, FunctionCallOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, StreamOperator) +TEST(OpenSpaceToolkit_Core_Container_Table, StreamOperator) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -384,14 +384,14 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, StreamOperator) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, Iterator) +TEST(OpenSpaceToolkit_Core_Container_Table, Iterator) { - using ostk::core::types::Index; - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::Index; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -433,13 +433,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, Iterator) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, IsEmpty) +TEST(OpenSpaceToolkit_Core_Container_Table, IsEmpty) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -467,13 +467,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, IsEmpty) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, HasColumnWithName) +TEST(OpenSpaceToolkit_Core_Container_Table, HasColumnWithName) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -511,13 +511,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, HasColumnWithName) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, GetRowCount) +TEST(OpenSpaceToolkit_Core_Container_Table, GetRowCount) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -537,13 +537,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, GetRowCount) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, GetColumnCount) +TEST(OpenSpaceToolkit_Core_Container_Table, GetColumnCount) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -563,13 +563,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, GetColumnCount) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, GetIndexOfColumnWithName) +TEST(OpenSpaceToolkit_Core_Container_Table, GetIndexOfColumnWithName) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -593,13 +593,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, GetIndexOfColumnWithName) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, AddRow) +TEST(OpenSpaceToolkit_Core_Container_Table, AddRow) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -631,13 +631,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, AddRow) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, Clear) +TEST(OpenSpaceToolkit_Core_Container_Table, Clear) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; { const Array header = {"Column A", "Column B"}; @@ -657,9 +657,9 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, Clear) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, Empty) +TEST(OpenSpaceToolkit_Core_Container_Table, Empty) { - using ostk::core::ctnr::Table; + using ostk::core::container::Table; { EXPECT_NO_THROW(Table::Empty()); @@ -667,13 +667,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, Empty) } } -TEST(OpenSpaceToolkit_Core_Containers_Table, Load) +TEST(OpenSpaceToolkit_Core_Container_Table, Load) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; - using ostk::core::ctnr::Object; - using ostk::core::ctnr::Table; - using ostk::core::ctnr::table::Row; + using ostk::core::type::String; + using ostk::core::container::Array; + using ostk::core::container::Object; + using ostk::core::container::Table; + using ostk::core::container::table::Row; using ostk::core::filesystem::Path; using ostk::core::filesystem::File; @@ -696,7 +696,7 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, Load) const Table referenceTable = {header, rows}; - const File file = File::Path(Path::Parse("/app/test/OpenSpaceToolkit/Core/Containers/Table/A.csv")); + const File file = File::Path(Path::Parse("/app/test/OpenSpaceToolkit/Core/Container/Table/A.csv")); const Table table = Table::Load(file); @@ -725,7 +725,7 @@ TEST(OpenSpaceToolkit_Core_Containers_Table, Load) const Table referenceTable = {header, rows}; - const File file = File::Path(Path::Parse("/app/test/OpenSpaceToolkit/Core/Containers/Table/B.csv")); + const File file = File::Path(Path::Parse("/app/test/OpenSpaceToolkit/Core/Container/Table/B.csv")); const Table table = Table::Load(file); diff --git a/test/OpenSpaceToolkit/Core/Containers/Table/A.csv b/test/OpenSpaceToolkit/Core/Container/Table/A.csv similarity index 100% rename from test/OpenSpaceToolkit/Core/Containers/Table/A.csv rename to test/OpenSpaceToolkit/Core/Container/Table/A.csv diff --git a/test/OpenSpaceToolkit/Core/Containers/Table/B.csv b/test/OpenSpaceToolkit/Core/Container/Table/B.csv similarity index 100% rename from test/OpenSpaceToolkit/Core/Containers/Table/B.csv rename to test/OpenSpaceToolkit/Core/Container/Table/B.csv diff --git a/test/OpenSpaceToolkit/Core/Containers/Triple.test.cpp b/test/OpenSpaceToolkit/Core/Container/Triple.test.cpp similarity index 57% rename from test/OpenSpaceToolkit/Core/Containers/Triple.test.cpp rename to test/OpenSpaceToolkit/Core/Container/Triple.test.cpp index 8eec8aed..927dee36 100644 --- a/test/OpenSpaceToolkit/Core/Containers/Triple.test.cpp +++ b/test/OpenSpaceToolkit/Core/Container/Triple.test.cpp @@ -1,27 +1,27 @@ /// Apache License 2.0 -#include -#include -#include +#include +#include +#include #include -TEST(OpenSpaceToolkit_Core_Containers_Triple, Constructor) +TEST(OpenSpaceToolkit_Core_Container_Triple, Constructor) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Triple; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Triple; { const Triple triple = {true, 123, "abc"}; } } -TEST(OpenSpaceToolkit_Core_Containers_Triple, Getters) +TEST(OpenSpaceToolkit_Core_Container_Triple, Getters) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Triple; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Triple; { const Triple triple = {true, 123, "abc"}; @@ -32,11 +32,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Triple, Getters) } } -TEST(OpenSpaceToolkit_Core_Containers_Triple, Setters) +TEST(OpenSpaceToolkit_Core_Container_Triple, Setters) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Triple; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Triple; { Triple triple = {true, 123, "abc"}; @@ -55,13 +55,13 @@ TEST(OpenSpaceToolkit_Core_Containers_Triple, Setters) } } -// TEST (OpenSpaceToolkit_Core_Containers_Triple, Unpack) +// TEST (OpenSpaceToolkit_Core_Container_Triple, Unpack) // { -// using ostk::core::types::Integer ; -// using ostk::core::types::String ; -// using ostk::core::ctnr::Triple ; -// using ostk::core::ctnr::Unpack ; +// using ostk::core::type::Integer ; +// using ostk::core::type::String ; +// using ostk::core::container::Triple ; +// using ostk::core::container::Unpack ; // { diff --git a/test/OpenSpaceToolkit/Core/Containers/Tuple.test.cpp b/test/OpenSpaceToolkit/Core/Container/Tuple.test.cpp similarity index 63% rename from test/OpenSpaceToolkit/Core/Containers/Tuple.test.cpp rename to test/OpenSpaceToolkit/Core/Container/Tuple.test.cpp index d09b12f2..e9f7fb85 100644 --- a/test/OpenSpaceToolkit/Core/Containers/Tuple.test.cpp +++ b/test/OpenSpaceToolkit/Core/Container/Tuple.test.cpp @@ -1,27 +1,27 @@ /// Apache License 2.0 -#include -#include -#include +#include +#include +#include #include -TEST(OpenSpaceToolkit_Core_Containers_Tuple, Constructor) +TEST(OpenSpaceToolkit_Core_Container_Tuple, Constructor) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Tuple; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Tuple; { const Tuple tuple = {123, "abc", 456, "def"}; } } -TEST(OpenSpaceToolkit_Core_Containers_Tuple, Getters) +TEST(OpenSpaceToolkit_Core_Container_Tuple, Getters) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Tuple; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Tuple; { const Tuple tuple = {123, "abc", 456, "def"}; @@ -33,11 +33,11 @@ TEST(OpenSpaceToolkit_Core_Containers_Tuple, Getters) } } -TEST(OpenSpaceToolkit_Core_Containers_Tuple, Setters) +TEST(OpenSpaceToolkit_Core_Container_Tuple, Setters) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Tuple; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Tuple; { Tuple tuple = {123, "abc", 456, "def"}; @@ -57,12 +57,12 @@ TEST(OpenSpaceToolkit_Core_Containers_Tuple, Setters) } } -TEST(OpenSpaceToolkit_Core_Containers_Tuple, Unpack) +TEST(OpenSpaceToolkit_Core_Container_Tuple, Unpack) { - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Tuple; - using ostk::core::ctnr::Unpack; + using ostk::core::type::Integer; + using ostk::core::type::String; + using ostk::core::container::Tuple; + using ostk::core::container::Unpack; { const Tuple tuple = {123, "abc", 456, "def"}; diff --git a/test/OpenSpaceToolkit/Core/Containers/Pair.test.cpp b/test/OpenSpaceToolkit/Core/Containers/Pair.test.cpp deleted file mode 100644 index ccbaf4f4..00000000 --- a/test/OpenSpaceToolkit/Core/Containers/Pair.test.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/// Apache License 2.0 - -#include -#include -#include - -#include - -TEST(OpenSpaceToolkit_Core_Containers_Pair, Constructor) -{ - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Pair; - - { - const Pair pair = {123, "abc"}; - } -} - -TEST(OpenSpaceToolkit_Core_Containers_Pair, Getters) -{ - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Pair; - - { - const Pair pair = {123, "abc"}; - - EXPECT_EQ(123, pair.first); - EXPECT_EQ("abc", pair.second); - } -} - -TEST(OpenSpaceToolkit_Core_Containers_Pair, Setters) -{ - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Pair; - - { - Pair pair = {123, "abc"}; - - EXPECT_EQ(123, pair.first); - EXPECT_EQ("abc", pair.second); - - pair.first = 456; - pair.second = "def"; - - EXPECT_EQ(456, pair.first); - EXPECT_EQ("def", pair.second); - } -} - -TEST(OpenSpaceToolkit_Core_Containers_Pair, Unpack) -{ - using ostk::core::types::Integer; - using ostk::core::types::String; - using ostk::core::ctnr::Pair; - using ostk::core::ctnr::Unpack; - - { - const Pair pair = {123, "abc"}; - - Integer integer = Integer::Undefined(); - String string = String::Empty(); - - Unpack(integer, string) = pair; - - EXPECT_EQ(123, integer); - EXPECT_EQ("abc", string); - } -} diff --git a/test/OpenSpaceToolkit/Core/FileSystem/Directory.test.cpp b/test/OpenSpaceToolkit/Core/FileSystem/Directory.test.cpp index 255c18fb..2a641fb3 100644 --- a/test/OpenSpaceToolkit/Core/FileSystem/Directory.test.cpp +++ b/test/OpenSpaceToolkit/Core/FileSystem/Directory.test.cpp @@ -150,10 +150,10 @@ TEST(OpenSpaceToolkit_Core_FileSystem_Directory, ContainsFileWithName) const Directory directory = Directory::Path(Path::Parse("/app/include/OpenSpaceToolkit/Core")); EXPECT_TRUE(directory.containsFileWithName("Error.hpp")); - EXPECT_TRUE(directory.containsFileWithName("Utilities.hpp")); + EXPECT_TRUE(directory.containsFileWithName("Utility.hpp")); EXPECT_FALSE(directory.containsFileWithName("Error")); - EXPECT_FALSE(directory.containsFileWithName("Utilities")); + EXPECT_FALSE(directory.containsFileWithName("Utility")); EXPECT_FALSE(directory.containsFileWithName("abc")); } @@ -341,8 +341,8 @@ TEST(OpenSpaceToolkit_Core_FileSystem_Directory, GetParentDirectory) TEST(OpenSpaceToolkit_Core_FileSystem_Directory, GetDirectories) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::String; + using ostk::core::container::Array; using ostk::core::filesystem::Path; using ostk::core::filesystem::Directory; diff --git a/test/OpenSpaceToolkit/Core/Types/Integer.test.cpp b/test/OpenSpaceToolkit/Core/Type/Integer.test.cpp similarity index 84% rename from test/OpenSpaceToolkit/Core/Types/Integer.test.cpp rename to test/OpenSpaceToolkit/Core/Type/Integer.test.cpp index 83f8ce1a..75280c1f 100644 --- a/test/OpenSpaceToolkit/Core/Types/Integer.test.cpp +++ b/test/OpenSpaceToolkit/Core/Type/Integer.test.cpp @@ -1,17 +1,17 @@ /// Apache License 2.0 -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -TEST(OpenSpaceToolkit_Core_Types_Integer, DefaultConstructor) +TEST(OpenSpaceToolkit_Core_Type_Integer, DefaultConstructor) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_NO_THROW(Integer(0)); EXPECT_NO_THROW(Integer(1)); @@ -20,9 +20,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, DefaultConstructor) EXPECT_NO_THROW(Integer(-123)); } -TEST(OpenSpaceToolkit_Core_Types_Integer, AssignmentOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, AssignmentOperator) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_NO_THROW(Integer a = 0; (void)a;); EXPECT_NO_THROW(Integer a = 0; (void)a;); @@ -32,9 +32,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, AssignmentOperator) EXPECT_NO_THROW(Integer a = -123; (void)a;); } -TEST(OpenSpaceToolkit_Core_Types_Integer, EqualToOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, EqualToOperator) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { EXPECT_TRUE(Integer(0) == Integer(0)); @@ -65,9 +65,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, EqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, NotEqualToOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, NotEqualToOperator) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { EXPECT_TRUE(Integer(0) != Integer(1)); @@ -98,9 +98,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, NotEqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, LessThanOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, LessThanOperator) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { EXPECT_TRUE(Integer(0) < Integer(1)); @@ -139,9 +139,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, LessThanOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, LessThanOrEqualToOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, LessThanOrEqualToOperator) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { EXPECT_TRUE(Integer(0) <= Integer(1)); @@ -180,9 +180,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, LessThanOrEqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, GreaterThanOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, GreaterThanOperator) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { EXPECT_TRUE(Integer(1) > Integer(0)); @@ -221,9 +221,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, GreaterThanOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, GreaterThanOrEqualToOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, GreaterThanOrEqualToOperator) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { EXPECT_TRUE(Integer(1) >= Integer(0)); @@ -262,11 +262,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, GreaterThanOrEqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, AdditionOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, AdditionOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -418,11 +418,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, AdditionOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, SubtractionOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, SubtractionOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -570,11 +570,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, SubtractionOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, MultiplicationOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, MultiplicationOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -752,11 +752,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, MultiplicationOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, DivisionOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, DivisionOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -900,11 +900,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, DivisionOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, ModuloOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, ModuloOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -1070,11 +1070,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, ModuloOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, AdditionAssignmentOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, AdditionAssignmentOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -1228,11 +1228,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, AdditionAssignmentOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, SubtractionAssignmentOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, SubtractionAssignmentOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -1382,11 +1382,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, SubtractionAssignmentOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, MultiplicationAssignmentOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, MultiplicationAssignmentOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -1566,11 +1566,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, MultiplicationAssignmentOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, DivisionAssignmentOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, DivisionAssignmentOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -1716,11 +1716,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, DivisionAssignmentOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, ModuloAssignmentOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, ModuloAssignmentOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -1888,11 +1888,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, ModuloAssignmentOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, UnaryPlusOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, UnaryPlusOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Pair; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Pair; + using ostk::core::container::Array; Array> testCases = { @@ -1938,11 +1938,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, UnaryPlusOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, UnaryMinusOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, UnaryMinusOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Pair; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Pair; + using ostk::core::container::Array; Array> testCases = { @@ -1988,11 +1988,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, UnaryMinusOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, PrefixIncrementOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, PrefixIncrementOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Pair; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Pair; + using ostk::core::container::Array; Array> testCases = { @@ -2055,11 +2055,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, PrefixIncrementOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, PrefixDecrementOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, PrefixDecrementOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Pair; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Pair; + using ostk::core::container::Array; Array> testCases = { @@ -2122,11 +2122,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, PrefixDecrementOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, PostfixIncrementOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, PostfixIncrementOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Pair; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Pair; + using ostk::core::container::Array; Array> testCases = { @@ -2209,11 +2209,11 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, PostfixIncrementOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, PostfixDecrementOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, PostfixDecrementOperator) { - using ostk::core::types::Integer; - using ostk::core::ctnr::Pair; - using ostk::core::ctnr::Array; + using ostk::core::type::Integer; + using ostk::core::container::Pair; + using ostk::core::container::Array; Array> testCases = { @@ -2296,9 +2296,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, PostfixDecrementOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, ValueTypeOperator) +TEST(OpenSpaceToolkit_Core_Type_Integer, ValueTypeOperator) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { EXPECT_ANY_THROW(Integer::ValueType a = Integer::Undefined(); (void)a;); @@ -2337,18 +2337,18 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, ValueTypeOperator) } } -// TEST (OpenSpaceToolkit_Core_Types_Integer, StreamOperator) +// TEST (OpenSpaceToolkit_Core_Type_Integer, StreamOperator) // { -// using ostk::core::types::Integer ; +// using ostk::core::type::Integer ; // FAIL() ; // } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsDefined) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsDefined) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer(0).isDefined()); EXPECT_TRUE(Integer(-1).isDefined()); @@ -2362,9 +2362,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsDefined) EXPECT_FALSE(Integer::Undefined().isDefined()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsZero) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsZero) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer(0).isZero()); EXPECT_TRUE(Integer(+0).isZero()); @@ -2378,9 +2378,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsZero) EXPECT_FALSE(Integer::Undefined().isZero()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsPositive) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsPositive) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer(0).isPositive()); EXPECT_TRUE(Integer(+0).isPositive()); @@ -2394,9 +2394,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsPositive) EXPECT_FALSE(Integer::NegativeInfinity().isPositive()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsNegative) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsNegative) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer(0).isNegative()); EXPECT_TRUE(Integer(-1).isNegative()); @@ -2410,9 +2410,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsNegative) EXPECT_FALSE(Integer::PositiveInfinity().isNegative()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsStrictlyPositive) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsStrictlyPositive) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer(+1).isStrictlyPositive()); EXPECT_TRUE(Integer(std::numeric_limits::max()).isStrictlyPositive()); @@ -2426,9 +2426,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsStrictlyPositive) EXPECT_FALSE(Integer::NegativeInfinity().isStrictlyPositive()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsStrictlyNegative) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsStrictlyNegative) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer(-1).isStrictlyNegative()); EXPECT_TRUE(Integer(std::numeric_limits::min()).isStrictlyNegative()); @@ -2442,9 +2442,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsStrictlyNegative) EXPECT_FALSE(Integer::PositiveInfinity().isStrictlyNegative()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsInfinity) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsInfinity) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer::NegativeInfinity().isInfinity()); EXPECT_TRUE(Integer::PositiveInfinity().isInfinity()); @@ -2458,9 +2458,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsInfinity) EXPECT_FALSE(Integer(std::numeric_limits::max()).isInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsPositiveInfinity) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsPositiveInfinity) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer::PositiveInfinity().isPositiveInfinity()); @@ -2474,9 +2474,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsPositiveInfinity) EXPECT_FALSE(Integer::NegativeInfinity().isPositiveInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsNegativeInfinity) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsNegativeInfinity) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer::NegativeInfinity().isNegativeInfinity()); @@ -2490,9 +2490,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsNegativeInfinity) EXPECT_FALSE(Integer::PositiveInfinity().isNegativeInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsFinite) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsFinite) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer(0).isFinite()); EXPECT_TRUE(Integer(-1).isFinite()); @@ -2506,9 +2506,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsFinite) EXPECT_FALSE(Integer::Undefined().isFinite()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsEven) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsEven) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer(0).isEven()); @@ -2528,9 +2528,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsEven) EXPECT_FALSE(Integer::Undefined().isEven()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, IsOdd) +TEST(OpenSpaceToolkit_Core_Type_Integer, IsOdd) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_TRUE(Integer(-3).isOdd()); EXPECT_TRUE(Integer(-1).isOdd()); @@ -2546,10 +2546,10 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, IsOdd) EXPECT_FALSE(Integer::Undefined().isOdd()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, GetSign) +TEST(OpenSpaceToolkit_Core_Type_Integer, GetSign) { - using ostk::core::types::Sign; - using ostk::core::types::Integer; + using ostk::core::type::Sign; + using ostk::core::type::Integer; EXPECT_EQ(Sign::Undefined, Integer::Undefined().getSign()); EXPECT_EQ(Sign::None, Integer(0).getSign()); @@ -2562,9 +2562,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, GetSign) EXPECT_EQ(Sign::Positive, Integer::PositiveInfinity().getSign()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, ToString) +TEST(OpenSpaceToolkit_Core_Type_Integer, ToString) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_EQ("Undefined", Integer::Undefined().toString()); EXPECT_EQ("0", Integer(0).toString()); @@ -2575,18 +2575,18 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, ToString) EXPECT_EQ("+Inf", Integer::PositiveInfinity().toString()); } -// TEST (OpenSpaceToolkit_Core_Types_Integer, GetObject) +// TEST (OpenSpaceToolkit_Core_Type_Integer, GetObject) // { -// using ostk::core::types::Integer ; +// using ostk::core::type::Integer ; // FAIL() ; // } -TEST(OpenSpaceToolkit_Core_Types_Integer, Undefined) +TEST(OpenSpaceToolkit_Core_Type_Integer, Undefined) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_NO_THROW(Integer::Undefined()); @@ -2594,9 +2594,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, Undefined) EXPECT_FALSE(Integer::Undefined().isInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, PositiveInfinity) +TEST(OpenSpaceToolkit_Core_Type_Integer, PositiveInfinity) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_NO_THROW(Integer::PositiveInfinity()); @@ -2605,9 +2605,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, PositiveInfinity) EXPECT_TRUE(Integer::PositiveInfinity().isPositiveInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, NegativeInfinity) +TEST(OpenSpaceToolkit_Core_Type_Integer, NegativeInfinity) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; EXPECT_NO_THROW(Integer::NegativeInfinity()); @@ -2616,402 +2616,402 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, NegativeInfinity) EXPECT_TRUE(Integer::NegativeInfinity().isNegativeInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Integer, Int8) +TEST(OpenSpaceToolkit_Core_Type_Integer, Int8) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { - EXPECT_NO_THROW(Integer::Int8(ostk::core::types::Int8(0))); + EXPECT_NO_THROW(Integer::Int8(ostk::core::type::Int8(0))); - EXPECT_NO_THROW(Integer::Int8(ostk::core::types::Int8(-1))); - EXPECT_NO_THROW(Integer::Int8(ostk::core::types::Int8(+1))); + EXPECT_NO_THROW(Integer::Int8(ostk::core::type::Int8(-1))); + EXPECT_NO_THROW(Integer::Int8(ostk::core::type::Int8(+1))); - EXPECT_NO_THROW(Integer::Int8(ostk::core::types::Int8(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Int8(ostk::core::types::Int8(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Int8(ostk::core::type::Int8(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Int8(ostk::core::type::Int8(std::numeric_limits::max()))); } { - EXPECT_EQ(0, Integer::Int8(ostk::core::types::Int8(0))); + EXPECT_EQ(0, Integer::Int8(ostk::core::type::Int8(0))); - EXPECT_EQ(-1, Integer::Int8(ostk::core::types::Int8(-1))); - EXPECT_EQ(+1, Integer::Int8(ostk::core::types::Int8(+1))); + EXPECT_EQ(-1, Integer::Int8(ostk::core::type::Int8(-1))); + EXPECT_EQ(+1, Integer::Int8(ostk::core::type::Int8(+1))); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Int8(ostk::core::types::Int8(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Int8(ostk::core::type::Int8(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Int8(ostk::core::types::Int8(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Int8(ostk::core::type::Int8(std::numeric_limits::max())) ); } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Int16) +TEST(OpenSpaceToolkit_Core_Type_Integer, Int16) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { - EXPECT_NO_THROW(Integer::Int16(ostk::core::types::Int16(0))); + EXPECT_NO_THROW(Integer::Int16(ostk::core::type::Int16(0))); - EXPECT_NO_THROW(Integer::Int16(ostk::core::types::Int16(-1))); - EXPECT_NO_THROW(Integer::Int16(ostk::core::types::Int16(+1))); + EXPECT_NO_THROW(Integer::Int16(ostk::core::type::Int16(-1))); + EXPECT_NO_THROW(Integer::Int16(ostk::core::type::Int16(+1))); - EXPECT_NO_THROW(Integer::Int16(ostk::core::types::Int16(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Int16(ostk::core::types::Int16(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Int16(ostk::core::type::Int16(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Int16(ostk::core::type::Int16(std::numeric_limits::max()))); - EXPECT_NO_THROW(Integer::Int16(ostk::core::types::Int16(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Int16(ostk::core::types::Int16(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Int16(ostk::core::type::Int16(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Int16(ostk::core::type::Int16(std::numeric_limits::max()))); } { - EXPECT_EQ(0, Integer::Int16(ostk::core::types::Int16(0))); + EXPECT_EQ(0, Integer::Int16(ostk::core::type::Int16(0))); - EXPECT_EQ(-1, Integer::Int16(ostk::core::types::Int16(-1))); - EXPECT_EQ(+1, Integer::Int16(ostk::core::types::Int16(+1))); + EXPECT_EQ(-1, Integer::Int16(ostk::core::type::Int16(-1))); + EXPECT_EQ(+1, Integer::Int16(ostk::core::type::Int16(+1))); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Int16(ostk::core::types::Int16(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Int16(ostk::core::type::Int16(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Int16(ostk::core::types::Int16(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Int16(ostk::core::type::Int16(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Int16(ostk::core::types::Int16(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Int16(ostk::core::type::Int16(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Int16(ostk::core::types::Int16(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Int16(ostk::core::type::Int16(std::numeric_limits::max())) ); } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Int32) +TEST(OpenSpaceToolkit_Core_Type_Integer, Int32) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { - EXPECT_NO_THROW(Integer::Int32(ostk::core::types::Int32(0))); + EXPECT_NO_THROW(Integer::Int32(ostk::core::type::Int32(0))); - EXPECT_NO_THROW(Integer::Int32(ostk::core::types::Int32(-1))); - EXPECT_NO_THROW(Integer::Int32(ostk::core::types::Int32(+1))); + EXPECT_NO_THROW(Integer::Int32(ostk::core::type::Int32(-1))); + EXPECT_NO_THROW(Integer::Int32(ostk::core::type::Int32(+1))); - EXPECT_NO_THROW(Integer::Int32(ostk::core::types::Int32(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Int32(ostk::core::types::Int32(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Int32(ostk::core::type::Int32(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Int32(ostk::core::type::Int32(std::numeric_limits::max()))); - EXPECT_NO_THROW(Integer::Int32(ostk::core::types::Int32(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Int32(ostk::core::types::Int32(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Int32(ostk::core::type::Int32(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Int32(ostk::core::type::Int32(std::numeric_limits::max()))); - EXPECT_NO_THROW(Integer::Int32(ostk::core::types::Int32(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Int32(ostk::core::types::Int32(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Int32(ostk::core::type::Int32(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Int32(ostk::core::type::Int32(std::numeric_limits::max()))); } { - EXPECT_EQ(0, Integer::Int32(ostk::core::types::Int32(0))); + EXPECT_EQ(0, Integer::Int32(ostk::core::type::Int32(0))); - EXPECT_EQ(-1, Integer::Int32(ostk::core::types::Int32(-1))); - EXPECT_EQ(+1, Integer::Int32(ostk::core::types::Int32(+1))); + EXPECT_EQ(-1, Integer::Int32(ostk::core::type::Int32(-1))); + EXPECT_EQ(+1, Integer::Int32(ostk::core::type::Int32(+1))); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Int32(ostk::core::types::Int32(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Int32(ostk::core::type::Int32(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Int32(ostk::core::types::Int32(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Int32(ostk::core::type::Int32(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Int32(ostk::core::types::Int32(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Int32(ostk::core::type::Int32(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Int32(ostk::core::types::Int32(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Int32(ostk::core::type::Int32(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Int32(ostk::core::types::Int32(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Int32(ostk::core::type::Int32(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Int32(ostk::core::types::Int32(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Int32(ostk::core::type::Int32(std::numeric_limits::max())) ); } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Int64) +TEST(OpenSpaceToolkit_Core_Type_Integer, Int64) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { - EXPECT_NO_THROW(Integer::Int64(ostk::core::types::Int64(0))); + EXPECT_NO_THROW(Integer::Int64(ostk::core::type::Int64(0))); - EXPECT_NO_THROW(Integer::Int64(ostk::core::types::Int64(-1))); - EXPECT_NO_THROW(Integer::Int64(ostk::core::types::Int64(+1))); + EXPECT_NO_THROW(Integer::Int64(ostk::core::type::Int64(-1))); + EXPECT_NO_THROW(Integer::Int64(ostk::core::type::Int64(+1))); - EXPECT_NO_THROW(Integer::Int64(ostk::core::types::Int64(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Int64(ostk::core::types::Int64(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Int64(ostk::core::type::Int64(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Int64(ostk::core::type::Int64(std::numeric_limits::max()))); - EXPECT_NO_THROW(Integer::Int64(ostk::core::types::Int64(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Int64(ostk::core::types::Int64(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Int64(ostk::core::type::Int64(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Int64(ostk::core::type::Int64(std::numeric_limits::max()))); - EXPECT_NO_THROW(Integer::Int64(ostk::core::types::Int64(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Int64(ostk::core::types::Int64(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Int64(ostk::core::type::Int64(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Int64(ostk::core::type::Int64(std::numeric_limits::max()))); EXPECT_ANY_THROW( - Integer::Int64(ostk::core::types::Int64(std::numeric_limits::min()) - 1) + Integer::Int64(ostk::core::type::Int64(std::numeric_limits::min()) - 1) ); EXPECT_ANY_THROW( - Integer::Int64(ostk::core::types::Int64(std::numeric_limits::max()) + 1) + Integer::Int64(ostk::core::type::Int64(std::numeric_limits::max()) + 1) ); - EXPECT_ANY_THROW(Integer::Int64(ostk::core::types::Int64(std::numeric_limits::min())) + EXPECT_ANY_THROW(Integer::Int64(ostk::core::type::Int64(std::numeric_limits::min())) ); - EXPECT_ANY_THROW(Integer::Int64(ostk::core::types::Int64(std::numeric_limits::max())) + EXPECT_ANY_THROW(Integer::Int64(ostk::core::type::Int64(std::numeric_limits::max())) ); } { - EXPECT_EQ(0, Integer::Int64(ostk::core::types::Int64(0))); + EXPECT_EQ(0, Integer::Int64(ostk::core::type::Int64(0))); - EXPECT_EQ(-1, Integer::Int64(ostk::core::types::Int64(-1))); - EXPECT_EQ(+1, Integer::Int64(ostk::core::types::Int64(+1))); + EXPECT_EQ(-1, Integer::Int64(ostk::core::type::Int64(-1))); + EXPECT_EQ(+1, Integer::Int64(ostk::core::type::Int64(+1))); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Int64(ostk::core::types::Int64(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Int64(ostk::core::type::Int64(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Int64(ostk::core::types::Int64(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Int64(ostk::core::type::Int64(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Int64(ostk::core::types::Int64(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Int64(ostk::core::type::Int64(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Int64(ostk::core::types::Int64(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Int64(ostk::core::type::Int64(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Int64(ostk::core::types::Int64(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Int64(ostk::core::type::Int64(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Int64(ostk::core::types::Int64(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Int64(ostk::core::type::Int64(std::numeric_limits::max())) ); } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Uint8) +TEST(OpenSpaceToolkit_Core_Type_Integer, Uint8) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { - EXPECT_NO_THROW(Integer::Uint8(ostk::core::types::Uint8(0))); + EXPECT_NO_THROW(Integer::Uint8(ostk::core::type::Uint8(0))); - EXPECT_NO_THROW(Integer::Uint8(ostk::core::types::Uint8(+1))); + EXPECT_NO_THROW(Integer::Uint8(ostk::core::type::Uint8(+1))); - EXPECT_NO_THROW(Integer::Uint8(ostk::core::types::Uint8(std::numeric_limits::min()))); - EXPECT_NO_THROW(Integer::Uint8(ostk::core::types::Uint8(std::numeric_limits::max()))); + EXPECT_NO_THROW(Integer::Uint8(ostk::core::type::Uint8(std::numeric_limits::min()))); + EXPECT_NO_THROW(Integer::Uint8(ostk::core::type::Uint8(std::numeric_limits::max()))); } { - EXPECT_EQ(0, Integer::Uint8(ostk::core::types::Uint8(0))); + EXPECT_EQ(0, Integer::Uint8(ostk::core::type::Uint8(0))); - EXPECT_EQ(+1, Integer::Uint8(ostk::core::types::Uint8(+1))); + EXPECT_EQ(+1, Integer::Uint8(ostk::core::type::Uint8(+1))); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint8(ostk::core::types::Uint8(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint8(ostk::core::type::Uint8(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Uint8(ostk::core::types::Uint8(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Uint8(ostk::core::type::Uint8(std::numeric_limits::max())) ); } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Uint16) +TEST(OpenSpaceToolkit_Core_Type_Integer, Uint16) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { - EXPECT_NO_THROW(Integer::Uint16(ostk::core::types::Uint16(0))); + EXPECT_NO_THROW(Integer::Uint16(ostk::core::type::Uint16(0))); - EXPECT_NO_THROW(Integer::Uint16(ostk::core::types::Uint16(+1))); + EXPECT_NO_THROW(Integer::Uint16(ostk::core::type::Uint16(+1))); - EXPECT_NO_THROW(Integer::Uint16(ostk::core::types::Uint16(std::numeric_limits::min())) + EXPECT_NO_THROW(Integer::Uint16(ostk::core::type::Uint16(std::numeric_limits::min())) ); - EXPECT_NO_THROW(Integer::Uint16(ostk::core::types::Uint16(std::numeric_limits::max())) + EXPECT_NO_THROW(Integer::Uint16(ostk::core::type::Uint16(std::numeric_limits::max())) ); - EXPECT_NO_THROW(Integer::Uint16(ostk::core::types::Uint16(std::numeric_limits::min()) + EXPECT_NO_THROW(Integer::Uint16(ostk::core::type::Uint16(std::numeric_limits::min()) )); - EXPECT_NO_THROW(Integer::Uint16(ostk::core::types::Uint16(std::numeric_limits::max()) + EXPECT_NO_THROW(Integer::Uint16(ostk::core::type::Uint16(std::numeric_limits::max()) )); } { - EXPECT_EQ(0, Integer::Uint16(ostk::core::types::Uint16(0))); + EXPECT_EQ(0, Integer::Uint16(ostk::core::type::Uint16(0))); - EXPECT_EQ(+1, Integer::Uint16(ostk::core::types::Uint16(+1))); + EXPECT_EQ(+1, Integer::Uint16(ostk::core::type::Uint16(+1))); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint16(ostk::core::types::Uint16(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint16(ostk::core::type::Uint16(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Uint16(ostk::core::types::Uint16(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Uint16(ostk::core::type::Uint16(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint16(ostk::core::types::Uint16(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint16(ostk::core::type::Uint16(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Uint16(ostk::core::types::Uint16(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Uint16(ostk::core::type::Uint16(std::numeric_limits::max())) ); } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Uint32) +TEST(OpenSpaceToolkit_Core_Type_Integer, Uint32) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { - EXPECT_NO_THROW(Integer::Uint32(ostk::core::types::Uint32(0))); + EXPECT_NO_THROW(Integer::Uint32(ostk::core::type::Uint32(0))); - EXPECT_NO_THROW(Integer::Uint32(ostk::core::types::Uint32(+1))); + EXPECT_NO_THROW(Integer::Uint32(ostk::core::type::Uint32(+1))); - EXPECT_NO_THROW(Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::min())) + EXPECT_NO_THROW(Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::min())) ); - EXPECT_NO_THROW(Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::min())) + EXPECT_NO_THROW(Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::min())) ); - EXPECT_NO_THROW(Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::min()) + EXPECT_NO_THROW(Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::min()) )); - EXPECT_NO_THROW(Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::min()) + EXPECT_NO_THROW(Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::min()) )); - EXPECT_NO_THROW(Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::min()) + EXPECT_NO_THROW(Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::min()) )); - EXPECT_ANY_THROW(Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::max() + EXPECT_ANY_THROW(Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::max() ))); } { - EXPECT_EQ(0, Integer::Uint32(ostk::core::types::Uint32(0))); + EXPECT_EQ(0, Integer::Uint32(ostk::core::type::Uint32(0))); - EXPECT_EQ(+1, Integer::Uint32(ostk::core::types::Uint32(+1))); + EXPECT_EQ(+1, Integer::Uint32(ostk::core::type::Uint32(+1))); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint32(ostk::core::types::Uint32(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint32(ostk::core::type::Uint32(std::numeric_limits::min())) ); } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Uint64) +TEST(OpenSpaceToolkit_Core_Type_Integer, Uint64) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; { - EXPECT_NO_THROW(Integer::Uint64(ostk::core::types::Uint64(0))); + EXPECT_NO_THROW(Integer::Uint64(ostk::core::type::Uint64(0))); - EXPECT_NO_THROW(Integer::Uint64(ostk::core::types::Uint64(+1))); + EXPECT_NO_THROW(Integer::Uint64(ostk::core::type::Uint64(+1))); - EXPECT_NO_THROW(Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::min())) + EXPECT_NO_THROW(Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::min())) ); - EXPECT_NO_THROW(Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::max())) + EXPECT_NO_THROW(Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::max())) ); - EXPECT_NO_THROW(Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::min()) + EXPECT_NO_THROW(Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::min()) )); - EXPECT_NO_THROW(Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::max()) + EXPECT_NO_THROW(Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::max()) )); - EXPECT_NO_THROW(Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::min()) + EXPECT_NO_THROW(Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::min()) )); - EXPECT_NO_THROW(Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::min()) + EXPECT_NO_THROW(Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::min()) )); - EXPECT_ANY_THROW(Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::max() + EXPECT_ANY_THROW(Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::max() ))); - EXPECT_ANY_THROW(Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::max() + EXPECT_ANY_THROW(Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::max() ))); } { - EXPECT_EQ(0, Integer::Uint64(ostk::core::types::Uint64(0))); + EXPECT_EQ(0, Integer::Uint64(ostk::core::type::Uint64(0))); - EXPECT_EQ(+1, Integer::Uint64(ostk::core::types::Uint64(+1))); + EXPECT_EQ(+1, Integer::Uint64(ostk::core::type::Uint64(+1))); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::max(), - Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::max())) + std::numeric_limits::max(), + Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::max())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::min())) ); EXPECT_EQ( - std::numeric_limits::min(), - Integer::Uint64(ostk::core::types::Uint64(std::numeric_limits::min())) + std::numeric_limits::min(), + Integer::Uint64(ostk::core::type::Uint64(std::numeric_limits::min())) ); } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Index) +TEST(OpenSpaceToolkit_Core_Type_Integer, Index) { - using ostk::core::types::Index; - using ostk::core::types::Integer; + using ostk::core::type::Index; + using ostk::core::type::Integer; { EXPECT_EQ(0, Integer::Index(Index(0))); @@ -3023,10 +3023,10 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, Index) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Size) +TEST(OpenSpaceToolkit_Core_Type_Integer, Size) { - using ostk::core::types::Size; - using ostk::core::types::Integer; + using ostk::core::type::Size; + using ostk::core::type::Integer; { EXPECT_EQ(0, Integer::Size(Size(0))); @@ -3038,9 +3038,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, Size) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, CanParse) +TEST(OpenSpaceToolkit_Core_Type_Integer, CanParse) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; // Char @@ -3082,9 +3082,9 @@ TEST(OpenSpaceToolkit_Core_Types_Integer, CanParse) } } -TEST(OpenSpaceToolkit_Core_Types_Integer, Parse) +TEST(OpenSpaceToolkit_Core_Type_Integer, Parse) { - using ostk::core::types::Integer; + using ostk::core::type::Integer; // Char diff --git a/test/OpenSpaceToolkit/Core/Types/Real.test.cpp b/test/OpenSpaceToolkit/Core/Type/Real.test.cpp similarity index 94% rename from test/OpenSpaceToolkit/Core/Types/Real.test.cpp rename to test/OpenSpaceToolkit/Core/Type/Real.test.cpp index 74c78282..dc45e2db 100644 --- a/test/OpenSpaceToolkit/Core/Types/Real.test.cpp +++ b/test/OpenSpaceToolkit/Core/Type/Real.test.cpp @@ -2,16 +2,16 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include #include -TEST(OpenSpaceToolkit_Core_Types_Real, DefaultConstructor) +TEST(OpenSpaceToolkit_Core_Type_Real, DefaultConstructor) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real(0.0)); EXPECT_NO_THROW(Real(1.0)); @@ -20,9 +20,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, DefaultConstructor) EXPECT_NO_THROW(Real(-123.0)); } -TEST(OpenSpaceToolkit_Core_Types_Real, AssignmentOperator) +TEST(OpenSpaceToolkit_Core_Type_Real, AssignmentOperator) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real a = 0.0; (void)a;); EXPECT_NO_THROW(Real a = 0.0; (void)a;); @@ -32,9 +32,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, AssignmentOperator) EXPECT_NO_THROW(Real a = -123.0; (void)a;); } -TEST(OpenSpaceToolkit_Core_Types_Real, EqualToOperator) +TEST(OpenSpaceToolkit_Core_Type_Real, EqualToOperator) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_TRUE(Real(0.0) == Real(0.0)); @@ -56,9 +56,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, EqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Real, NotEqualToOperator) +TEST(OpenSpaceToolkit_Core_Type_Real, NotEqualToOperator) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_TRUE(Real(0.0) != Real(1.0)); @@ -80,9 +80,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, NotEqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Real, LessThanOperator) +TEST(OpenSpaceToolkit_Core_Type_Real, LessThanOperator) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_TRUE(Real(0.0) < Real(1.0)); @@ -108,9 +108,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, LessThanOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Real, LessThanOrEqualToOperator) +TEST(OpenSpaceToolkit_Core_Type_Real, LessThanOrEqualToOperator) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_TRUE(Real(0.0) <= Real(1.0)); @@ -136,9 +136,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, LessThanOrEqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Real, GreaterThanOperator) +TEST(OpenSpaceToolkit_Core_Type_Real, GreaterThanOperator) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_TRUE(Real(1.0) > Real(0.0)); @@ -164,9 +164,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, GreaterThanOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Real, GreaterThanOrEqualToOperator) +TEST(OpenSpaceToolkit_Core_Type_Real, GreaterThanOrEqualToOperator) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_TRUE(Real(1.0) >= Real(0.0)); @@ -192,11 +192,11 @@ TEST(OpenSpaceToolkit_Core_Types_Real, GreaterThanOrEqualToOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Real, AdditionOperator) +TEST(OpenSpaceToolkit_Core_Type_Real, AdditionOperator) { - using ostk::core::types::Real; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Real; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -348,11 +348,11 @@ TEST(OpenSpaceToolkit_Core_Types_Real, AdditionOperator) } } -TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) +TEST(OpenSpaceToolkit_Core_Type_Real, SubtractionOperator) { - using ostk::core::types::Real; - using ostk::core::ctnr::Triple; - using ostk::core::ctnr::Array; + using ostk::core::type::Real; + using ostk::core::container::Triple; + using ostk::core::container::Array; Array> testCases = { @@ -500,12 +500,12 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) } } -// TEST (OpenSpaceToolkit_Core_Types_Real, MultiplicationOperator) +// TEST (OpenSpaceToolkit_Core_Type_Real, MultiplicationOperator) // { -// using ostk::core::types::Real ; -// using ostk::core::ctnr::Triple ; -// using ostk::core::ctnr::Array ; +// using ostk::core::type::Real ; +// using ostk::core::container::Triple ; +// using ostk::core::container::Array ; // Array> testCases = // { @@ -683,12 +683,12 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) // } -// TEST (OpenSpaceToolkit_Core_Types_Real, DivisionOperator) +// TEST (OpenSpaceToolkit_Core_Type_Real, DivisionOperator) // { -// using ostk::core::types::Real ; -// using ostk::core::ctnr::Triple ; -// using ostk::core::ctnr::Array ; +// using ostk::core::type::Real ; +// using ostk::core::container::Triple ; +// using ostk::core::container::Array ; // Array> testCases = // { @@ -838,12 +838,12 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) // } -// TEST (OpenSpaceToolkit_Core_Types_Real, AdditionAssignmentOperator) +// TEST (OpenSpaceToolkit_Core_Type_Real, AdditionAssignmentOperator) // { -// using ostk::core::types::Real ; -// using ostk::core::ctnr::Triple ; -// using ostk::core::ctnr::Array ; +// using ostk::core::type::Real ; +// using ostk::core::container::Triple ; +// using ostk::core::container::Array ; // Array> testCases = // { @@ -998,12 +998,12 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) // } -// TEST (OpenSpaceToolkit_Core_Types_Real, SubtractionAssignmentOperator) +// TEST (OpenSpaceToolkit_Core_Type_Real, SubtractionAssignmentOperator) // { -// using ostk::core::types::Real ; -// using ostk::core::ctnr::Triple ; -// using ostk::core::ctnr::Array ; +// using ostk::core::type::Real ; +// using ostk::core::container::Triple ; +// using ostk::core::container::Array ; // Array> testCases = // { @@ -1156,12 +1156,12 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) // } -// TEST (OpenSpaceToolkit_Core_Types_Real, MultiplicationAssignmentOperator) +// TEST (OpenSpaceToolkit_Core_Type_Real, MultiplicationAssignmentOperator) // { -// using ostk::core::types::Real ; -// using ostk::core::ctnr::Triple ; -// using ostk::core::ctnr::Array ; +// using ostk::core::type::Real ; +// using ostk::core::container::Triple ; +// using ostk::core::container::Array ; // Array> testCases = // { @@ -1341,12 +1341,12 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) // } -// TEST (OpenSpaceToolkit_Core_Types_Real, DivisionAssignmentOperator) +// TEST (OpenSpaceToolkit_Core_Type_Real, DivisionAssignmentOperator) // { -// using ostk::core::types::Real ; -// using ostk::core::ctnr::Triple ; -// using ostk::core::ctnr::Array ; +// using ostk::core::type::Real ; +// using ostk::core::container::Triple ; +// using ostk::core::container::Array ; // Array> testCases = // { @@ -1498,12 +1498,12 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) // } -// TEST (OpenSpaceToolkit_Core_Types_Real, UnaryPlusOperator) +// TEST (OpenSpaceToolkit_Core_Type_Real, UnaryPlusOperator) // { -// using ostk::core::types::Real ; -// using ostk::core::ctnr::Pair ; -// using ostk::core::ctnr::Array ; +// using ostk::core::type::Real ; +// using ostk::core::container::Pair ; +// using ostk::core::container::Array ; // Array> testCases = // { @@ -1555,12 +1555,12 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) // } -// TEST (OpenSpaceToolkit_Core_Types_Real, UnaryMinusOperator) +// TEST (OpenSpaceToolkit_Core_Type_Real, UnaryMinusOperator) // { -// using ostk::core::types::Real ; -// using ostk::core::ctnr::Pair ; -// using ostk::core::ctnr::Array ; +// using ostk::core::type::Real ; +// using ostk::core::container::Pair ; +// using ostk::core::container::Array ; // Array> testCases = // { @@ -1612,10 +1612,10 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) // } -// TEST (OpenSpaceToolkit_Core_Types_Real, ValueTypeOperator) +// TEST (OpenSpaceToolkit_Core_Type_Real, ValueTypeOperator) // { -// using ostk::core::types::Real ; +// using ostk::core::type::Real ; // { @@ -1669,18 +1669,18 @@ TEST(OpenSpaceToolkit_Core_Types_Real, SubtractionOperator) // } -// // TEST (OpenSpaceToolkit_Core_Types_Real, StreamOperator) +// // TEST (OpenSpaceToolkit_Core_Type_Real, StreamOperator) // // { -// // using ostk::core::types::Real ; +// // using ostk::core::type::Real ; // // FAIL() ; // // } -TEST(OpenSpaceToolkit_Core_Types_Real, IsDefined) +TEST(OpenSpaceToolkit_Core_Type_Real, IsDefined) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real(0.0).isDefined()); EXPECT_TRUE(Real(-1.0).isDefined()); @@ -1694,9 +1694,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsDefined) EXPECT_FALSE(Real::Undefined().isDefined()); } -TEST(OpenSpaceToolkit_Core_Types_Real, IsZero) +TEST(OpenSpaceToolkit_Core_Type_Real, IsZero) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real(0.0).isZero()); EXPECT_TRUE(Real(+0.0).isZero()); @@ -1710,9 +1710,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsZero) EXPECT_FALSE(Real::Undefined().isZero()); } -TEST(OpenSpaceToolkit_Core_Types_Real, IsPositive) +TEST(OpenSpaceToolkit_Core_Type_Real, IsPositive) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real(0.0).isPositive()); EXPECT_TRUE(Real(+0.0).isPositive()); @@ -1726,9 +1726,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsPositive) EXPECT_FALSE(Real::NegativeInfinity().isPositive()); } -TEST(OpenSpaceToolkit_Core_Types_Real, IsNegative) +TEST(OpenSpaceToolkit_Core_Type_Real, IsNegative) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real(0.0).isNegative()); EXPECT_TRUE(Real(-1.0).isNegative()); @@ -1742,9 +1742,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsNegative) EXPECT_FALSE(Real::PositiveInfinity().isNegative()); } -TEST(OpenSpaceToolkit_Core_Types_Real, IsStrictlyPositive) +TEST(OpenSpaceToolkit_Core_Type_Real, IsStrictlyPositive) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real(+1.0).isStrictlyPositive()); EXPECT_TRUE(Real(std::numeric_limits::max()).isStrictlyPositive()); @@ -1758,9 +1758,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsStrictlyPositive) EXPECT_FALSE(Real::NegativeInfinity().isStrictlyPositive()); } -TEST(OpenSpaceToolkit_Core_Types_Real, IsStrictlyNegative) +TEST(OpenSpaceToolkit_Core_Type_Real, IsStrictlyNegative) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real(-1.0).isStrictlyNegative()); EXPECT_TRUE(Real(std::numeric_limits::lowest()).isStrictlyNegative()); @@ -1774,9 +1774,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsStrictlyNegative) EXPECT_FALSE(Real::PositiveInfinity().isStrictlyNegative()); } -TEST(OpenSpaceToolkit_Core_Types_Real, IsInfinity) +TEST(OpenSpaceToolkit_Core_Type_Real, IsInfinity) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real::NegativeInfinity().isInfinity()); EXPECT_TRUE(Real::PositiveInfinity().isInfinity()); @@ -1790,9 +1790,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsInfinity) EXPECT_FALSE(Real(std::numeric_limits::max()).isInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Real, IsPositiveInfinity) +TEST(OpenSpaceToolkit_Core_Type_Real, IsPositiveInfinity) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real::PositiveInfinity().isPositiveInfinity()); @@ -1806,9 +1806,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsPositiveInfinity) EXPECT_FALSE(Real::NegativeInfinity().isPositiveInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Real, IsNegativeInfinity) +TEST(OpenSpaceToolkit_Core_Type_Real, IsNegativeInfinity) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real::NegativeInfinity().isNegativeInfinity()); @@ -1822,9 +1822,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsNegativeInfinity) EXPECT_FALSE(Real::PositiveInfinity().isNegativeInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Real, IsInteger) +TEST(OpenSpaceToolkit_Core_Type_Real, IsInteger) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_TRUE(Real(0.0).isInteger()); @@ -1859,9 +1859,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsInteger) } } -TEST(OpenSpaceToolkit_Core_Types_Real, IsFinite) +TEST(OpenSpaceToolkit_Core_Type_Real, IsFinite) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_TRUE(Real(0.0).isFinite()); @@ -1883,9 +1883,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsFinite) } } -TEST(OpenSpaceToolkit_Core_Types_Real, IsNear) +TEST(OpenSpaceToolkit_Core_Type_Real, IsNear) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_TRUE(Real(0.0).isNear(Real(0.0), 0.0)); @@ -1912,10 +1912,10 @@ TEST(OpenSpaceToolkit_Core_Types_Real, IsNear) } } -TEST(OpenSpaceToolkit_Core_Types_Real, GetSign) +TEST(OpenSpaceToolkit_Core_Type_Real, GetSign) { - using ostk::core::types::Sign; - using ostk::core::types::Real; + using ostk::core::type::Sign; + using ostk::core::type::Real; EXPECT_EQ(Sign::Undefined, Real::Undefined().getSign()); EXPECT_EQ(Sign::None, Real(0.0).getSign()); @@ -1928,9 +1928,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, GetSign) EXPECT_EQ(Sign::Positive, Real::PositiveInfinity().getSign()); } -TEST(OpenSpaceToolkit_Core_Types_Real, ToString) +TEST(OpenSpaceToolkit_Core_Type_Real, ToString) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_EQ("0.0", Real(0.0).toString()); @@ -2157,10 +2157,10 @@ TEST(OpenSpaceToolkit_Core_Types_Real, ToString) } } -TEST(OpenSpaceToolkit_Core_Types_Real, ToInteger) +TEST(OpenSpaceToolkit_Core_Type_Real, ToInteger) { - using ostk::core::types::Integer; - using ostk::core::types::Real; + using ostk::core::type::Integer; + using ostk::core::type::Real; { EXPECT_EQ(0, Real(0.0).toInteger()); @@ -2179,9 +2179,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, ToInteger) } } -TEST(OpenSpaceToolkit_Core_Types_Real, Abs) +TEST(OpenSpaceToolkit_Core_Type_Real, Abs) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_EQ(0.0, Real(0.0).abs()); @@ -2209,9 +2209,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, Abs) } } -TEST(OpenSpaceToolkit_Core_Types_Real, Floor) +TEST(OpenSpaceToolkit_Core_Type_Real, Floor) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_EQ(+0, Real(0.0).floor()); @@ -2234,9 +2234,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, Floor) } } -TEST(OpenSpaceToolkit_Core_Types_Real, Sqrt) +TEST(OpenSpaceToolkit_Core_Type_Real, Sqrt) { - using ostk::core::types::Real; + using ostk::core::type::Real; { EXPECT_EQ(0.0, Real(0.0).sqrt()); @@ -2269,9 +2269,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, Sqrt) } } -TEST(OpenSpaceToolkit_Core_Types_Real, Undefined) +TEST(OpenSpaceToolkit_Core_Type_Real, Undefined) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real::Undefined()); @@ -2279,9 +2279,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, Undefined) EXPECT_FALSE(Real::Undefined().isInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Real, Zero) +TEST(OpenSpaceToolkit_Core_Type_Real, Zero) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real::Zero()); EXPECT_TRUE(Real::Zero().isDefined()); @@ -2289,9 +2289,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, Zero) EXPECT_EQ(0.0, Real::Zero()); } -TEST(OpenSpaceToolkit_Core_Types_Real, Pi) +TEST(OpenSpaceToolkit_Core_Type_Real, Pi) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real::Pi()); EXPECT_TRUE(Real::Pi().isDefined()); @@ -2299,9 +2299,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, Pi) EXPECT_EQ(M_PI, Real::Pi()); } -TEST(OpenSpaceToolkit_Core_Types_Real, HalfPi) +TEST(OpenSpaceToolkit_Core_Type_Real, HalfPi) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real::HalfPi()); EXPECT_TRUE(Real::HalfPi().isDefined()); @@ -2309,9 +2309,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, HalfPi) EXPECT_EQ(M_PI / 2.0, Real::HalfPi()); } -TEST(OpenSpaceToolkit_Core_Types_Real, TwoPi) +TEST(OpenSpaceToolkit_Core_Type_Real, TwoPi) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real::TwoPi()); EXPECT_TRUE(Real::TwoPi().isDefined()); @@ -2319,9 +2319,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, TwoPi) EXPECT_EQ(2.0 * M_PI, Real::TwoPi()); } -TEST(OpenSpaceToolkit_Core_Types_Real, Epsilon) +TEST(OpenSpaceToolkit_Core_Type_Real, Epsilon) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real::Epsilon()); EXPECT_TRUE(Real::Epsilon().isDefined()); @@ -2330,9 +2330,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, Epsilon) EXPECT_EQ(1e-15, Real::Epsilon()); } -TEST(OpenSpaceToolkit_Core_Types_Real, PositiveInfinity) +TEST(OpenSpaceToolkit_Core_Type_Real, PositiveInfinity) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real::PositiveInfinity()); @@ -2341,9 +2341,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, PositiveInfinity) EXPECT_TRUE(Real::PositiveInfinity().isPositiveInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Real, NegativeInfinity) +TEST(OpenSpaceToolkit_Core_Type_Real, NegativeInfinity) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_NO_THROW(Real::NegativeInfinity()); @@ -2352,10 +2352,10 @@ TEST(OpenSpaceToolkit_Core_Types_Real, NegativeInfinity) EXPECT_TRUE(Real::NegativeInfinity().isNegativeInfinity()); } -TEST(OpenSpaceToolkit_Core_Types_Real, Integer) +TEST(OpenSpaceToolkit_Core_Type_Real, Integer) { - using ostk::core::types::Integer; - using ostk::core::types::Real; + using ostk::core::type::Integer; + using ostk::core::type::Real; { EXPECT_NO_THROW(Real::Integer(Integer(123))); @@ -2374,9 +2374,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, Integer) } } -TEST(OpenSpaceToolkit_Core_Types_Real, CanParse) +TEST(OpenSpaceToolkit_Core_Type_Real, CanParse) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_TRUE(Real::CanParse("Undefined")); @@ -2417,9 +2417,9 @@ TEST(OpenSpaceToolkit_Core_Types_Real, CanParse) EXPECT_FALSE(Real::CanParse("+1e600")); } -TEST(OpenSpaceToolkit_Core_Types_Real, Parse) +TEST(OpenSpaceToolkit_Core_Type_Real, Parse) { - using ostk::core::types::Real; + using ostk::core::type::Real; EXPECT_FALSE(Real::Parse("Undefined").isDefined()); EXPECT_FALSE(Real::Parse("NaN").isDefined()); diff --git a/test/OpenSpaceToolkit/Core/Types/Sign.test.cpp b/test/OpenSpaceToolkit/Core/Type/Sign.test.cpp similarity index 68% rename from test/OpenSpaceToolkit/Core/Types/Sign.test.cpp rename to test/OpenSpaceToolkit/Core/Type/Sign.test.cpp index 5e22870e..8f792b54 100644 --- a/test/OpenSpaceToolkit/Core/Types/Sign.test.cpp +++ b/test/OpenSpaceToolkit/Core/Type/Sign.test.cpp @@ -1,12 +1,12 @@ /// Apache License 2.0 -#include +#include #include -TEST(OpenSpaceToolkit_Core_Types_Sign, DefaultConstructor) +TEST(OpenSpaceToolkit_Core_Type_Sign, DefaultConstructor) { - using ostk::core::types::Sign; + using ostk::core::type::Sign; EXPECT_NO_THROW(Sign sign = Sign::Undefined; (void)sign;); EXPECT_NO_THROW(Sign sign = Sign::Positive; (void)sign;); diff --git a/test/OpenSpaceToolkit/Core/Types/String.test.cpp b/test/OpenSpaceToolkit/Core/Type/String.test.cpp similarity index 76% rename from test/OpenSpaceToolkit/Core/Types/String.test.cpp rename to test/OpenSpaceToolkit/Core/Type/String.test.cpp index 15a7e123..0ebc7e8c 100644 --- a/test/OpenSpaceToolkit/Core/Types/String.test.cpp +++ b/test/OpenSpaceToolkit/Core/Type/String.test.cpp @@ -1,31 +1,31 @@ /// Apache License 2.0 -#include -#include -#include -#include +#include +#include +#include +#include #include -TEST(OpenSpaceToolkit_Core_Types_String, DefaultConstructor) +TEST(OpenSpaceToolkit_Core_Type_String, DefaultConstructor) { - using ostk::core::types::String; + using ostk::core::type::String; EXPECT_NO_THROW(String()); EXPECT_NO_THROW(String("abc")); } -TEST(OpenSpaceToolkit_Core_Types_String, StringConstructor) +TEST(OpenSpaceToolkit_Core_Type_String, StringConstructor) { - using ostk::core::types::String; + using ostk::core::type::String; EXPECT_NO_THROW(String(std::string(""))); EXPECT_NO_THROW(String(std::string("abc"))); } -TEST(OpenSpaceToolkit_Core_Types_String, StringOperator) +TEST(OpenSpaceToolkit_Core_Type_String, StringOperator) { - using ostk::core::types::String; + using ostk::core::type::String; { String A = "abc"; @@ -36,9 +36,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, StringOperator) } } -TEST(OpenSpaceToolkit_Core_Types_String, IsEmpty) +TEST(OpenSpaceToolkit_Core_Type_String, IsEmpty) { - using ostk::core::types::String; + using ostk::core::type::String; EXPECT_TRUE(String().isEmpty()); EXPECT_TRUE(String("").isEmpty()); @@ -47,9 +47,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, IsEmpty) EXPECT_FALSE(String("\n").isEmpty()); } -TEST(OpenSpaceToolkit_Core_Types_String, IsUppercase) +TEST(OpenSpaceToolkit_Core_Type_String, IsUppercase) { - using ostk::core::types::String; + using ostk::core::type::String; EXPECT_TRUE(String("ABC").isUppercase()); EXPECT_TRUE(String("A_B_C").isUppercase()); @@ -63,9 +63,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, IsUppercase) EXPECT_FALSE(String("abcABC").isUppercase()); } -TEST(OpenSpaceToolkit_Core_Types_String, IsLowercase) +TEST(OpenSpaceToolkit_Core_Type_String, IsLowercase) { - using ostk::core::types::String; + using ostk::core::type::String; EXPECT_TRUE(String("abc").isLowercase()); EXPECT_TRUE(String("a_b_c").isLowercase()); @@ -79,9 +79,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, IsLowercase) EXPECT_FALSE(String("abcABC").isLowercase()); } -TEST(OpenSpaceToolkit_Core_Types_String, Match) +TEST(OpenSpaceToolkit_Core_Type_String, Match) { - using ostk::core::types::String; + using ostk::core::type::String; { EXPECT_TRUE(String("abc").match(std::regex("^[a-z]{3}$"))); @@ -92,9 +92,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, Match) } } -TEST(OpenSpaceToolkit_Core_Types_String, GetLength) +TEST(OpenSpaceToolkit_Core_Type_String, GetLength) { - using ostk::core::types::String; + using ostk::core::type::String; EXPECT_EQ(size_t(0), String().getLength()); EXPECT_EQ(size_t(0), String("").getLength()); @@ -103,9 +103,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, GetLength) EXPECT_EQ(size_t(1), String("\n").getLength()); } -TEST(OpenSpaceToolkit_Core_Types_String, GetHead) +TEST(OpenSpaceToolkit_Core_Type_String, GetHead) { - using ostk::core::types::String; + using ostk::core::type::String; { EXPECT_EQ("abc", String("abcdef").getHead(3)); @@ -119,9 +119,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, GetHead) } } -TEST(OpenSpaceToolkit_Core_Types_String, GetTail) +TEST(OpenSpaceToolkit_Core_Type_String, GetTail) { - using ostk::core::types::String; + using ostk::core::type::String; { EXPECT_EQ("def", String("abcdef").getTail(3)); @@ -135,25 +135,25 @@ TEST(OpenSpaceToolkit_Core_Types_String, GetTail) } } -TEST(OpenSpaceToolkit_Core_Types_String, GetFirst) +TEST(OpenSpaceToolkit_Core_Type_String, GetFirst) { - using ostk::core::types::String; + using ostk::core::type::String; EXPECT_EQ('H', String("Hello World!").getFirst()); EXPECT_ANY_THROW(String("").getFirst()); } -TEST(OpenSpaceToolkit_Core_Types_String, GetLast) +TEST(OpenSpaceToolkit_Core_Type_String, GetLast) { - using ostk::core::types::String; + using ostk::core::type::String; EXPECT_EQ('!', String("Hello World!").getLast()); EXPECT_ANY_THROW(String("").getLast()); } -TEST(OpenSpaceToolkit_Core_Types_String, GetSubstring) +TEST(OpenSpaceToolkit_Core_Type_String, GetSubstring) { - using ostk::core::types::String; + using ostk::core::type::String; { EXPECT_EQ("abc", String("abcdef").getSubstring(0, 3)); @@ -168,10 +168,10 @@ TEST(OpenSpaceToolkit_Core_Types_String, GetSubstring) } } -TEST(OpenSpaceToolkit_Core_Types_String, Split) +TEST(OpenSpaceToolkit_Core_Type_String, Split) { - using ostk::core::types::String; - using ostk::core::ctnr::Array; + using ostk::core::type::String; + using ostk::core::container::Array; { EXPECT_EQ(Array({"a", "b", "c", ""}), String("a,b,c,").split(",")); @@ -186,9 +186,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, Split) } } -TEST(OpenSpaceToolkit_Core_Types_String, Trim) +TEST(OpenSpaceToolkit_Core_Type_String, Trim) { - using ostk::core::types::String; + using ostk::core::type::String; { EXPECT_EQ("", String("").trim()); @@ -208,9 +208,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, Trim) } } -TEST(OpenSpaceToolkit_Core_Types_String, Replace) +TEST(OpenSpaceToolkit_Core_Type_String, Replace) { - using ostk::core::types::String; + using ostk::core::type::String; // Char @@ -247,16 +247,16 @@ TEST(OpenSpaceToolkit_Core_Types_String, Replace) } } -TEST(OpenSpaceToolkit_Core_Types_String, Empty) +TEST(OpenSpaceToolkit_Core_Type_String, Empty) { - using ostk::core::types::String; + using ostk::core::type::String; EXPECT_TRUE(String::Empty().isEmpty()); } -TEST(OpenSpaceToolkit_Core_Types_String, Boolean) +TEST(OpenSpaceToolkit_Core_Type_String, Boolean) { - using ostk::core::types::String; + using ostk::core::type::String; { EXPECT_EQ("True", String::Boolean(true)); @@ -264,9 +264,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, Boolean) } } -TEST(OpenSpaceToolkit_Core_Types_String, Char) +TEST(OpenSpaceToolkit_Core_Type_String, Char) { - using ostk::core::types::String; + using ostk::core::type::String; { EXPECT_EQ("a", String::Char('a')); @@ -274,9 +274,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, Char) } } -TEST(OpenSpaceToolkit_Core_Types_String, Replicate) +TEST(OpenSpaceToolkit_Core_Type_String, Replicate) { - using ostk::core::types::String; + using ostk::core::type::String; { EXPECT_EQ("aaa", String::Replicate('a', 3)); @@ -290,11 +290,11 @@ TEST(OpenSpaceToolkit_Core_Types_String, Replicate) } } -TEST(OpenSpaceToolkit_Core_Types_String, Format) +TEST(OpenSpaceToolkit_Core_Type_String, Format) { - using ostk::core::types::Integer; - using ostk::core::types::Real; - using ostk::core::types::String; + using ostk::core::type::Integer; + using ostk::core::type::Real; + using ostk::core::type::String; { EXPECT_EQ("", String::Format("")); @@ -311,9 +311,9 @@ TEST(OpenSpaceToolkit_Core_Types_String, Format) } } -TEST(OpenSpaceToolkit_Core_Types_String, SanitizeUTF8) +TEST(OpenSpaceToolkit_Core_Type_String, SanitizeUTF8) { - using ostk::core::types::String; + using ostk::core::type::String; { const String invalid = "okdata\xa0\xa1morevalid"; diff --git a/tools/cmake/OpenSpaceToolkitCoreConfig.cmake.in b/tools/cmake/OpenSpaceToolkitCoreConfig.cmake.in index 8803d64a..be8287c6 100755 --- a/tools/cmake/OpenSpaceToolkitCoreConfig.cmake.in +++ b/tools/cmake/OpenSpaceToolkitCoreConfig.cmake.in @@ -2,7 +2,7 @@ SET (OpenSpaceToolkitCore_ROOT_DIR ${OpenSpaceToolkitCore_ROOT_DIR} @CMAKE_INSTALL_PREFIX@) -FIND_PATH (OpenSpaceToolkitCore_INCLUDE_DIR "OpenSpaceToolkit/Core/Utilities.hpp" PATHS ${OpenSpaceToolkitCore_ROOT_DIR} PATH_SUFFIXES "include" NO_DEFAULT_PATH) +FIND_PATH (OpenSpaceToolkitCore_INCLUDE_DIR "OpenSpaceToolkit/Core/Utility.hpp" PATHS ${OpenSpaceToolkitCore_ROOT_DIR} PATH_SUFFIXES "include" NO_DEFAULT_PATH) FIND_LIBRARY (OpenSpaceToolkitCore_LIBRARY NAMES "libopen-space-toolkit-core.so" PATHS ${OpenSpaceToolkitCore_ROOT_DIR} PATH_SUFFIXES "lib" NO_DEFAULT_PATH) # MESSAGE (STATUS "OpenSpaceToolkitCore_ROOT_DIR = ${OpenSpaceToolkitCore_ROOT_DIR}")