Skip to content

Commit

Permalink
feat(core): use CUBOS_CORE_API everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Mar 1, 2024
1 parent 3c0ab08 commit 94e07d0
Show file tree
Hide file tree
Showing 78 changed files with 243 additions and 189 deletions.
3 changes: 2 additions & 1 deletion core/include/cubos/core/data/des/deserializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <unordered_map>

#include <cubos/core/api.hpp>
#include <cubos/core/memory/function.hpp>
#include <cubos/core/reflection/reflect.hpp>

Expand All @@ -23,7 +24,7 @@ namespace cubos::core::data
/// at least the primitive types.
///
/// @ingroup core-data-des
class Deserializer
class CUBOS_CORE_API Deserializer
{
public:
virtual ~Deserializer() = default;
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/data/des/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace cubos::core::data
/// Before deserializing any data, a JSON object must be fed to the deserializer.
///
/// @ingroup core-data-des
class JSONDeserializer : public Deserializer
class CUBOS_CORE_API JSONDeserializer : public Deserializer
{
public:
/// @brief Constructs.
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/data/fs/archive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace cubos::core::data
/// @see File
/// @see FileSystem
/// @ingroup core-data-fs
class Archive
class CUBOS_CORE_API Archive
{
public:
Archive() = default;
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/data/fs/embedded_archive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace cubos::core::data
/// an instance of this archive.
///
/// @ingroup core-data-fs
class EmbeddedArchive : public Archive
class CUBOS_CORE_API EmbeddedArchive : public Archive
{
public:
/// @brief Describes the structure of the embedded data.
Expand Down
3 changes: 2 additions & 1 deletion core/include/cubos/core/data/fs/file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <mutex>
#include <string_view>

#include <cubos/core/api.hpp>
#include <cubos/core/memory/stream.hpp>

namespace cubos::core::data
Expand All @@ -32,7 +33,7 @@ namespace cubos::core::data
/// @see FileSystem
/// @see Archive
/// @ingroup core-data-fs
class File final : public std::enable_shared_from_this<File>
class CUBOS_CORE_API File final : public std::enable_shared_from_this<File>
{
public:
/// @brief Handle to a file in the CUBOS. virtual file system.
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/data/fs/file_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace cubos::core::data
///
/// @see File
/// @ingroup core-data-fs
class FileSystem final
class CUBOS_CORE_API FileSystem final
{
public:
FileSystem() = delete;
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/data/fs/standard_archive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace cubos::core::data
/// and FileSystem classes (#263).
///
/// @ingroup core-data-fs
class StandardArchive : public Archive
class CUBOS_CORE_API StandardArchive : public Archive
{
public:
~StandardArchive() override = default;
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/data/ser/debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace cubos::core::data
/// @brief Serializer implementation which prints the given data to a stream in a human-readable
/// format not meant to be parsed.
/// @ingroup core-data-ser
class DebugSerializer : public Serializer
class CUBOS_CORE_API DebugSerializer : public Serializer
{
public:
/// @brief Constructs.
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/data/ser/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace cubos::core::data
{
/// @brief Implementation of the abstract Serializer class for serializing to JSON.
class JSONSerializer : public Serializer
class CUBOS_CORE_API JSONSerializer : public Serializer
{
public:
/// @brief Constructs.
Expand Down
3 changes: 2 additions & 1 deletion core/include/cubos/core/data/ser/serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <unordered_map>

#include <cubos/core/api.hpp>
#include <cubos/core/memory/function.hpp>
#include <cubos/core/reflection/reflect.hpp>

Expand All @@ -23,7 +24,7 @@ namespace cubos::core::data
/// at least the primitive types.
///
/// @ingroup core-data-ser
class Serializer
class CUBOS_CORE_API Serializer
{
public:
virtual ~Serializer() = default;
Expand Down
6 changes: 3 additions & 3 deletions core/include/cubos/core/ecs/blueprint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace cubos::core::ecs
/// @param map Map of old entities to new entities.
/// @param type Value type.
/// @param value Value.
void convertEntities(const std::unordered_map<Entity, Entity, EntityHash>& map, const reflection::Type& type,
void* value);
CUBOS_CORE_API void convertEntities(const std::unordered_map<Entity, Entity, EntityHash>& map,
const reflection::Type& type, void* value);

/// @brief Collection of entities and their respective components and relations.
///
Expand All @@ -35,7 +35,7 @@ namespace cubos::core::ecs
/// not be replaced and thus continue referencing the original entity in the blueprint.
///
/// @ingroup core-ecs
class Blueprint final
class CUBOS_CORE_API Blueprint final
{
public:
/// @brief Function used by @ref instantiate to create entities.
Expand Down
3 changes: 2 additions & 1 deletion core/include/cubos/core/ecs/command_buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <unordered_map>
#include <vector>

#include <cubos/core/api.hpp>
#include <cubos/core/ecs/entity/entity.hpp>
#include <cubos/core/memory/function.hpp>

Expand All @@ -23,7 +24,7 @@ namespace cubos::core::ecs

/// @brief Stores commands to execute them later.
/// @ingroup core-ecs
class CommandBuffer final
class CUBOS_CORE_API CommandBuffer final
{
public:
/// @brief Constructs.
Expand Down
8 changes: 4 additions & 4 deletions core/include/cubos/core/ecs/cubos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace cubos::core::ecs

/// @brief Used to chain configurations related to tags.
/// @ingroup core-ecs
class TagBuilder
class CUBOS_CORE_API TagBuilder
{
public:
/// @brief Construct.
Expand Down Expand Up @@ -95,7 +95,7 @@ namespace cubos::core::ecs
/// @brief Represents the engine itself, and exposes the interface with which the game
/// developer interacts with. Ties up all the different parts of the engine together.
/// @ingroup core-ecs
class Cubos final
class CUBOS_CORE_API Cubos final
{
public:
/// @brief Used to create new systems.
Expand Down Expand Up @@ -201,7 +201,7 @@ namespace cubos::core::ecs
std::vector<std::string> mStartupTags;
};

class Cubos::SystemBuilder
class CUBOS_CORE_API Cubos::SystemBuilder
{
public:
/// @brief Constructs.
Expand Down Expand Up @@ -331,7 +331,7 @@ namespace cubos::core::ecs
int mDefaultTarget{0};
};

class Cubos::ObserverBuilder
class CUBOS_CORE_API Cubos::ObserverBuilder
{
public:
/// @brief Constructs.
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/ecs/entity/archetype_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace cubos::core::ecs
/// archetype's id.
///
/// @ingroup core-ecs-entity
class ArchetypeGraph
class CUBOS_CORE_API ArchetypeGraph
{
public:
/// @brief Constructs.
Expand Down
4 changes: 3 additions & 1 deletion core/include/cubos/core/ecs/entity/archetype_id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <cstddef>

#include <cubos/core/api.hpp>

namespace cubos::core::ecs
{
/// @brief Identifies an archetype.
Expand All @@ -24,7 +26,7 @@ namespace cubos::core::ecs
};

/// @brief Hash functor for @ref ArchetypeId.
struct ArchetypeIdHash
struct CUBOS_CORE_API ArchetypeIdHash
{
std::size_t operator()(const ArchetypeId& id) const;
};
Expand Down
3 changes: 2 additions & 1 deletion core/include/cubos/core/ecs/entity/entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <bitset>
#include <cstdint>

#include <cubos/core/api.hpp>
#include <cubos/core/reflection/reflect.hpp>

namespace cubos::core::ecs
Expand All @@ -19,7 +20,7 @@ namespace cubos::core::ecs
/// (de)serialized as objects with two fields: their index and their generation.
///
/// @ingroup core-ecs-entity
struct Entity
struct CUBOS_CORE_API Entity
{
CUBOS_REFLECT;

Expand Down
4 changes: 3 additions & 1 deletion core/include/cubos/core/ecs/entity/hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <cstddef>

#include <cubos/core/api.hpp>

namespace cubos::core::ecs
{
struct Entity;
Expand All @@ -15,7 +17,7 @@ namespace cubos::core::ecs
/// Can be used to allow @ref Entity objects to be used as keys in an `std::unordered_map`.
///
/// @ingroup core-ecs-entity
struct EntityHash
struct CUBOS_CORE_API EntityHash
{
std::size_t operator()(const Entity& entity) const noexcept;
};
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/ecs/entity/pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace cubos::core::ecs
/// @brief Manages the creation and destruction of entity identifiers, as well as storing their
/// archetype identifiers.
/// @ingroup core-ecs-entity
class EntityPool final
class CUBOS_CORE_API EntityPool final
{
public:
/// @brief Creates a new entity on the given archetype.
Expand Down
3 changes: 2 additions & 1 deletion core/include/cubos/core/ecs/name.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

#include <string>

#include <cubos/core/api.hpp>
#include <cubos/core/reflection/reflect.hpp>

namespace cubos::core::ecs
{
/// @brief Component which stores the name of an entity.
struct Name
struct CUBOS_CORE_API Name
{
CUBOS_REFLECT;

Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/ecs/observer/observers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace cubos::core::ecs
{
/// @brief Stores and manages all of the observers associated with a world.
/// @ingroup core-ecs-observer
class Observers
class CUBOS_CORE_API Observers
{
public:
~Observers();
Expand Down
6 changes: 3 additions & 3 deletions core/include/cubos/core/ecs/query/filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace cubos::core::ecs
/// @brief Used to find matches for the given query terms. Essentially contains the non-templated part of the query
/// logic.
/// @ingroup core-ecs-query
class QueryFilter
class CUBOS_CORE_API QueryFilter
{
public:
/// @brief Can be iterated to view the query matches.
Expand Down Expand Up @@ -66,7 +66,7 @@ namespace cubos::core::ecs
QueryNode::TargetMask mNodePins[QueryNode::MaxCursorCount];
};

class QueryFilter::View
class CUBOS_CORE_API QueryFilter::View
{
public:
/// @brief Used to iterate over the query matches.
Expand Down Expand Up @@ -118,7 +118,7 @@ namespace cubos::core::ecs
bool mDead{false};
};

class QueryFilter::View::Iterator
class CUBOS_CORE_API QueryFilter::View::Iterator
{
public:
/// @brief Output structure of the iterator.
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/ecs/query/node/archetype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace cubos::core::ecs
{
/// @brief Node which forces a given target to belong to a set of archetypes.
class QueryArchetypeNode final : public QueryNode
class CUBOS_CORE_API QueryArchetypeNode final : public QueryNode
{
public:
/// @brief Constructs.
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/ecs/query/node/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace cubos::core::ecs
class World;

/// @brief Query filter step, which receives an iterator and advances it until it points to a valid match.
class QueryNode
class CUBOS_CORE_API QueryNode
{
public:
/// @brief Target mask type.
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/ecs/query/node/related.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
namespace cubos::core::ecs
{
/// @brief Node which forces two given targets to be related with a given relation.
class QueryRelatedNode final : public QueryNode
class CUBOS_CORE_API QueryRelatedNode final : public QueryNode
{
public:
/// @brief Constructs.
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/ecs/query/term.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace cubos::core::ecs
/// - Entity terms, which don't filter the results but allow accessing one of the matched entities.
///
/// @ingroup core-ecs-query
struct QueryTerm
struct CUBOS_CORE_API QueryTerm
{
/// @brief Stores entity term data.
struct Entity
Expand Down
3 changes: 2 additions & 1 deletion core/include/cubos/core/ecs/resource/manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <unordered_map>
#include <utility>

#include <cubos/core/api.hpp>
#include <cubos/core/ecs/world.hpp>
#include <cubos/core/log.hpp>

Expand Down Expand Up @@ -75,7 +76,7 @@ namespace cubos::core::ecs
/// Used internally by @ref World.
///
/// @ingroup core-ecs-resource
class ResourceManager final
class CUBOS_CORE_API ResourceManager final
{
public:
ResourceManager() = default;
Expand Down
2 changes: 1 addition & 1 deletion core/include/cubos/core/ecs/system/access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace cubos::core::ecs
/// Used to determine if systems conflict with each other.
///
/// @ingroup core-ecs-system
struct SystemAccess
struct CUBOS_CORE_API SystemAccess
{
/// @brief Whether the system accesses the world directly.
bool usesWorld{false};
Expand Down
6 changes: 3 additions & 3 deletions core/include/cubos/core/ecs/system/arguments/commands.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace cubos::core::ecs
/// Internally wraps a reference to a CommandBuffer object.
///
/// @ingroup core-ecs-system-arguments
class Commands final
class CUBOS_CORE_API Commands final
{
public:
/// @brief Allows editing an entity created by a @ref Commands object.
Expand Down Expand Up @@ -132,7 +132,7 @@ namespace cubos::core::ecs
CommandBuffer& mBuffer; ///< Command buffer to write to.
};

class Commands::EntityBuilder final
class CUBOS_CORE_API Commands::EntityBuilder final
{
public:
/// @brief Constructs.
Expand Down Expand Up @@ -165,7 +165,7 @@ namespace cubos::core::ecs
Entity mEntity;
};

class Commands::BlueprintBuilder final
class CUBOS_CORE_API Commands::BlueprintBuilder final
{
public:
/// @brief Constructs.
Expand Down
Loading

0 comments on commit 94e07d0

Please sign in to comment.