Skip to content

Commit

Permalink
Make all public classes of CSP visible so that user extensions can ac…
Browse files Browse the repository at this point in the history
…cess them

Signed-off-by: Adam Glustein <adam.glustein@point72.com>
  • Loading branch information
AdamGlustein committed Oct 2, 2024
1 parent 1ce6f25 commit 5cc011e
Show file tree
Hide file tree
Showing 62 changed files with 101 additions and 95 deletions.
2 changes: 1 addition & 1 deletion cpp/csp/core/BasicAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace csp
{

// Extremely basic non-thread safe fixed-size allocator
class BasicAllocator
class CSP_PUBLIC BasicAllocator
{
public:
//elemsize is size of a single alloc, blockSize is number of elements to
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/core/DynamicBitSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace csp
{

template<typename NodeT = uint64_t, typename IndexT = int32_t>
class DynamicBitSet
class CSP_PUBLIC DynamicBitSet
{

public:
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/core/Enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ bool UnknownOnInvalidValue(long) { return false; }

START_PACKED
template<typename EnumTraits>
struct Enum : public EnumTraits
struct CSP_PUBLIC Enum : public EnumTraits
{
using EnumV = typename EnumTraits::_enum;
using Mapping = std::vector<std::string>;
Expand Down
4 changes: 3 additions & 1 deletion cpp/csp/core/EnumBitSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
#include <initializer_list>
#include <limits>

#include <csp/core/Platform.h>

namespace csp
{

//Utility class to hold enums as a bitmask ( where enum values are incremental from 0 )
//enum must have a NUM_TYPES entry for number of entries
template< typename EnumT >
class EnumBitSet
class CSP_PUBLIC EnumBitSet
{
using value_type = uint64_t;

Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/core/Generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace csp
{
template< typename V, typename ...Args >
class Generator
class CSP_PUBLIC Generator
{
public:
using Ptr = std::shared_ptr<Generator<V, Args...>>;
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/core/QueueWaiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace csp

class TimeDelta;

class QueueWaiter
class CSP_PUBLIC QueueWaiter
{
public:
QueueWaiter() : m_eventsPending( false )
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/core/SRMWLockFreeQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace csp
one of the simplest! template type is required to have an intrinsic next pointer
*/
template< typename T >
class alignas(CACHELINE_SIZE) SRMWLockFreeQueue
class CSP_PUBLIC alignas(CACHELINE_SIZE) SRMWLockFreeQueue
{
public:
class Batch
Expand Down
3 changes: 2 additions & 1 deletion cpp/csp/core/TaggedPointerUnion.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _IN_CSP_CORE_TAGGEDPOINTERUNION_H
#define _IN_CSP_CORE_TAGGEDPOINTERUNION_H

#include <csp/core/Platform.h>
#include <csp/core/System.h>

namespace csp
Expand All @@ -25,7 +26,7 @@ struct IndexOf<T, TypeList<TOther, Ts...> >


template<typename... Ts>
class TaggedPointerUnion
class CSP_PUBLIC TaggedPointerUnion
{
public:
static inline constexpr size_t NUM_TAGS = sizeof...(Ts);
Expand Down
10 changes: 5 additions & 5 deletions cpp/csp/core/Time.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const int64_t NANOS_PER_SECOND = 1000000000;
const int64_t SECONDS_PER_DAY = 86400;
const int64_t NANOS_PER_DAY = NANOS_PER_SECOND * SECONDS_PER_DAY;

class TimeDelta
class CSP_PUBLIC TimeDelta
{
public:
constexpr TimeDelta() : TimeDelta( TimeDelta::NONE() ) {}
Expand Down Expand Up @@ -165,7 +165,7 @@ inline std::ostream & operator <<( std::ostream &os, const TimeDelta & d )
return os;
}

class Date
class CSP_PUBLIC Date
{
public:
Date() : Date( NONE() ) {}
Expand Down Expand Up @@ -316,7 +316,7 @@ inline std::ostream & operator <<( std::ostream &os, const Date & d )
return os;
}

class Time
class CSP_PUBLIC Time
{
public:
Time() : Time( -1 ) {} //NONE
Expand Down Expand Up @@ -446,7 +446,7 @@ inline std::ostream & operator <<( std::ostream &os, const Time & t )

// Time is internally stored as an int64_t nanoseconds since 1970.
// All DateTime objects are stored as UTC and should be treated as such
class DateTime
class CSP_PUBLIC DateTime
{
public:
DateTime() : DateTime( DateTime::NONE() ) {}
Expand Down Expand Up @@ -597,7 +597,7 @@ inline std::ostream & operator <<( std::ostream &os, const DateTime & dt )
//Helper class to extract day/month/year/etc info from raw timestamp
//ie DateTimeEx dte( existingDt )
//dte.day, etc etc
class DateTimeEx : public DateTime
class CSP_PUBLIC DateTimeEx : public DateTime
{
public:
DateTimeEx( const DateTime & dt );
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/AdapterManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AdapterManager;

class Engine;

class ManagedSimInputAdapter : public InputAdapter
class CSP_PUBLIC ManagedSimInputAdapter : public InputAdapter
{
public:
ManagedSimInputAdapter( csp::Engine *engine, const CspTypePtr &type, AdapterManager *manager, PushMode pushMode );
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/AlarmInputAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace csp
{

template<typename T>
class AlarmInputAdapter final : public InputAdapter
class CSP_PUBLIC AlarmInputAdapter final : public InputAdapter
{
public:
AlarmInputAdapter( Engine * engine, CspTypePtr & type ) : InputAdapter( engine, type, PushMode::NON_COLLAPSING )
Expand Down
8 changes: 4 additions & 4 deletions cpp/csp/engine/BasketInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace csp

class Node;

class InputBasketInfo
class CSP_PUBLIC InputBasketInfo
{
using TickedInputs = std::vector<INOUT_ELEMID_TYPE>;

Expand Down Expand Up @@ -188,7 +188,7 @@ class InputBasketInfo
bool m_isDynamic;
};

class DynamicInputBasketInfo : public InputBasketInfo
class CSP_PUBLIC DynamicInputBasketInfo : public InputBasketInfo
{
public:
using ChangeCallback = std::function<void(const DialectGenericType & key,bool added, int64_t elemId, int64_t replaceId )>;
Expand Down Expand Up @@ -227,7 +227,7 @@ class DynamicInputBasketInfo : public InputBasketInfo
TimeDelta m_timeWindowPolicy;
};

class OutputBasketInfo
class CSP_PUBLIC OutputBasketInfo
{
public:
OutputBasketInfo( CspTypePtr & type, Node * node, size_t size, bool isDynamic = false );
Expand All @@ -254,7 +254,7 @@ class OutputBasketInfo
bool m_isDynamic;
};

class DynamicOutputBasketInfo : public OutputBasketInfo
class CSP_PUBLIC DynamicOutputBasketInfo : public OutputBasketInfo
{
public:
DynamicOutputBasketInfo( CspTypePtr & type, Node * node );
Expand Down
1 change: 1 addition & 0 deletions cpp/csp/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

csp_autogen( csp.impl.types.autogen_types autogen_types ENGINE_AUTOGEN_HEADER ENGINE_AUTOGEN_SOURCE )

set(CSP_TYPES_PUBLIC_HEADERS
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/Consumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace csp
class InputAdapter;

//Base of either regular Nodes or output adapters
class Consumer
class CSP_PUBLIC Consumer
{
public:
Consumer( Engine * );
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/CppNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace csp

//CppNode is used specifically for C++ defined Nodes, and should only be used
//for definig c++ nodes using the macros defined at the end
class CppNode : public csp::Node
class CSP_PUBLIC CppNode : public csp::Node
{
public:
using Shape = std::variant<std::uint64_t,std::vector<std::string>>;
Expand Down
6 changes: 3 additions & 3 deletions cpp/csp/engine/CspEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace csp

class CspEnumMeta;

class CspEnumInstance
class CSP_PUBLIC CspEnumInstance
{
public:
CspEnumInstance( std::string name, int64_t value, csp::CspEnumMeta * meta ) : m_name( name ), m_value( value ), m_meta( meta ) {}
Expand All @@ -34,7 +34,7 @@ class CspEnumInstance

//As an optimization we do NOT attach meta or value to every instance of an enum. Instead, the enum
//holds only a pointer to a singleton CspEnumInstance, which holds the value, name, and meta pointer.
class CspEnum
class CSP_PUBLIC CspEnum
{
public:
CspEnum();
Expand All @@ -58,7 +58,7 @@ class CspEnum

std::ostream &operator<<( std::ostream &os, const CspEnum & rhs );

class CspEnumMeta
class CSP_PUBLIC CspEnumMeta
{
public:
using ValueDef = std::unordered_map<std::string,int64_t>;
Expand Down
10 changes: 5 additions & 5 deletions cpp/csp/engine/CspType.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace csp

class CspStringType;

class CspType
class CSP_PUBLIC CspType
{
public:

Expand Down Expand Up @@ -115,7 +115,7 @@ class CspType
Type m_type;
};

class CspStringType : public CspType
class CSP_PUBLIC CspStringType : public CspType
{
public:
CspStringType(bool isBytes)
Expand All @@ -134,7 +134,7 @@ class CspEnum;

class CspEnumMeta;

class CspEnumType : public CspType
class CSP_PUBLIC CspEnumType : public CspType
{
public:
CspEnumType( std::shared_ptr<CspEnumMeta> & meta ) : CspType( CspType::Type::ENUM ),
Expand All @@ -154,7 +154,7 @@ using StructPtr = TypedStructPtr<Struct>;

class StructMeta;

class CspStructType : public CspType
class CSP_PUBLIC CspStructType : public CspType
{
public:
CspStructType( const std::shared_ptr<StructMeta> & meta ) : CspType( CspType::Type::STRUCT ),
Expand All @@ -167,7 +167,7 @@ class CspStructType : public CspType
std::shared_ptr<StructMeta> m_meta;
};

class CspArrayType : public CspType
class CSP_PUBLIC CspArrayType : public CspType
{
public:
CspArrayType( CspTypePtr elemType, bool isPyStructFastList = false ) :
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/CycleStepTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace csp
class Consumer;
class Profiler;

class CycleStepTable
class CSP_PUBLIC CycleStepTable
{
public:
CycleStepTable();
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/Dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using DictionaryPtr = std::shared_ptr<Dictionary>;
class StructMeta;
using StructMetaPtr = std::shared_ptr<StructMeta>;

class Dictionary
class CSP_PUBLIC Dictionary
{
public:
struct Data;
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/DynamicEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace csp
{

class DynamicEngine final : public Engine
class CSP_PUBLIC DynamicEngine final : public Engine
{
public:
using ShutdownFn = std::function<void()>;
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/DynamicNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class DynamicEngine;
//external inputs and triggering a cycle step.
//All dynamic engine input adapters as well as all external timeseries wired into dynamic are registered as inputs
//into the DynanicNode instance so that it can invoke cycle step at the appropriate times.
class DynamicNode final : public Node
class CSP_PUBLIC DynamicNode final : public Node
{
public:
using Outputs = std::vector<const TimeSeriesProvider *>;
Expand Down
4 changes: 2 additions & 2 deletions cpp/csp/engine/Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TimeSeriesProvider;
class Engine;
class RootEngine;

struct EngineOwned
struct CSP_PUBLIC EngineOwned
{
//force objects derived from EngineOwned to go through engine createOwnedObject methods
//little trick here to force all derivations to fail
Expand All @@ -34,7 +34,7 @@ struct EngineOwned
void operator delete( void* ptr ) { ::operator delete(ptr); }
};

class Engine
class CSP_PUBLIC Engine
{
using AdapterManagers = std::vector<std::shared_ptr<AdapterManager>>;
using InputAdapters = std::vector<std::unique_ptr<InputAdapter>>;
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace csp
{

// NOTE this must align with the python side Enum definition ///
struct PushModeTraits
struct CSP_PUBLIC PushModeTraits
{
enum _enum : unsigned char
{
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/EventPropagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace csp

class Consumer;

class EventPropagator
class CSP_PUBLIC EventPropagator
{
public:
EventPropagator();
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/Feedback.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ template<typename T>
class FeedbackInputAdapter;

template<typename T>
class FeedbackOutputAdapter final : public OutputAdapter
class CSP_PUBLIC FeedbackOutputAdapter final : public OutputAdapter
{
public:
FeedbackOutputAdapter( csp::Engine * engine,
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/GraphOutputAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace csp
//GraphOutputAdapters are also special in that they are registered in both a dynamic engine and the root engine as sahred_ptr. They make it into root
//so that the root processes them at the end of the csp.run call ( dynamics could be shutdown by then ). We also register in root
//to ensure we dont hit key clashses.
class GraphOutputAdapter : public OutputAdapter, public std::enable_shared_from_this<GraphOutputAdapter>
class CSP_PUBLIC GraphOutputAdapter : public OutputAdapter, public std::enable_shared_from_this<GraphOutputAdapter>
{
public:
GraphOutputAdapter( csp::Engine * engine, int32_t tickCount, TimeDelta tickHistory );
Expand Down
2 changes: 1 addition & 1 deletion cpp/csp/engine/InputAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace csp

class Consumer;

class InputAdapter : public TimeSeriesProvider, public EngineOwned
class CSP_PUBLIC InputAdapter : public TimeSeriesProvider, public EngineOwned
{
public:
InputAdapter( Engine * engine, const CspTypePtr & type, PushMode pushMode );
Expand Down
3 changes: 2 additions & 1 deletion cpp/csp/engine/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define _IN_CSP_ENGINE_NODE_H

#include <csp/core/Exception.h>
#include <csp/core/Platform.h>
#include <csp/engine/AlarmInputAdapter.h>
#include <csp/engine/BasketInfo.h>
#include <csp/engine/Consumer.h>
Expand All @@ -24,7 +25,7 @@ struct NodeDef
INOUT_ID_TYPE numOutputs;
};

class Node : public Consumer, public EngineOwned
class CSP_PUBLIC Node : public Consumer, public EngineOwned
{
public:
Node( NodeDef def, Engine * );
Expand Down
Loading

0 comments on commit 5cc011e

Please sign in to comment.