Skip to content

Commit 55e0541

Browse files
authored
Change typedef declarations to modern using aliases (#1217)
1 parent 59b5a2a commit 55e0541

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+129
-132
lines changed

src/sst/core/clock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ class Clock : public Action
102102
std::string toString() const override;
103103

104104
private:
105-
/* typedef std::list<Clock::HandlerBase*> HandlerMap_t; */
106-
typedef std::vector<Clock::HandlerBase*> StaticHandlerMap_t;
105+
/* using HandlerMap_t = std::list<Clock::HandlerBase*>; */
106+
using StaticHandlerMap_t = std::vector<Clock::HandlerBase*>;
107107

108108
Clock() {}
109109

src/sst/core/componentInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ComponentInfo
4242
{
4343

4444
public:
45-
typedef std::vector<ConfigStatistic> statEnableList_t; /*!< List of Enabled Statistics */
45+
using statEnableList_t = std::vector<ConfigStatistic>; /*!< List of Enabled Statistics */
4646

4747
// Share Flags for SubComponent loading
4848
static const uint64_t SHARE_PORTS = 0x1;
@@ -285,8 +285,8 @@ class ComponentInfoMap
285285
std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID> dataByID;
286286

287287
public:
288-
typedef std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID>::const_iterator
289-
const_iterator;
288+
using const_iterator =
289+
std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID>::const_iterator;
290290

291291
const_iterator begin() const { return dataByID.begin(); }
292292

src/sst/core/configGraph.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class Config;
3838
class TimeLord;
3939
class ConfigGraph;
4040

41-
typedef SparseVectorMap<ComponentId_t> ComponentIdMap_t;
42-
typedef std::vector<LinkId_t> LinkIdMap_t;
41+
using ComponentIdMap_t = SparseVectorMap<ComponentId_t>;
42+
using LinkIdMap_t = std::vector<LinkId_t>;
4343

4444
/** Represents the configuration of a generic Link */
4545
class ConfigLink : public SST::Core::Serialization::serializable
@@ -213,7 +213,7 @@ class ConfigStatOutput : public SST::Core::Serialization::serializable
213213
ImplementSerializable(SST::ConfigStatOutput)
214214
};
215215

216-
typedef SparseVectorMap<LinkId_t, ConfigLink*> ConfigLinkMap_t;
216+
using ConfigLinkMap_t = SparseVectorMap<LinkId_t, ConfigLink*>;
217217

218218
/**
219219
Class that represents a PortModule in ConfigGraph
@@ -396,16 +396,16 @@ class ConfigComponent : public SST::Core::Serialization::serializable
396396
};
397397

398398
/** Map names to Links */
399-
// typedef std::map<std::string,ConfigLink> ConfigLinkMap_t;
400-
// typedef SparseVectorMap<std::string,ConfigLink> ConfigLinkMap_t;
399+
// using ConfigLinkMap_t = std::map<std::string,ConfigLink>;
400+
// using ConfigLinkMap_t = SparseVectorMap<std::string,ConfigLink>;
401401
/** Map IDs to Components */
402-
typedef SparseVectorMap<ComponentId_t, ConfigComponent*> ConfigComponentMap_t;
402+
using ConfigComponentMap_t = SparseVectorMap<ComponentId_t, ConfigComponent*>;
403403
/** Map names to Components */
404-
typedef std::map<std::string, ComponentId_t> ConfigComponentNameMap_t;
404+
using ConfigComponentNameMap_t = std::map<std::string, ComponentId_t>;
405405
/** Map names to Parameter Sets: XML only */
406-
typedef std::map<std::string, Params*> ParamsMap_t;
406+
using ParamsMap_t = std::map<std::string, Params*>;
407407
/** Map names to variable values: XML only */
408-
typedef std::map<std::string, std::string> VariableMap_t;
408+
using VariableMap_t = std::map<std::string, std::string>;
409409

410410
class PartitionGraph;
411411

@@ -645,8 +645,8 @@ class PartitionLink
645645
}
646646
};
647647

648-
typedef SparseVectorMap<ComponentId_t, PartitionComponent*> PartitionComponentMap_t;
649-
typedef SparseVectorMap<LinkId_t, PartitionLink> PartitionLinkMap_t;
648+
using PartitionComponentMap_t = SparseVectorMap<ComponentId_t, PartitionComponent*>;
649+
using PartitionLinkMap_t = SparseVectorMap<LinkId_t, PartitionLink>;
650650

651651
class PartitionGraph
652652
{

src/sst/core/eli/elementbuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace SST::ELI {
2121
template <class Base, class... Args>
2222
struct Builder
2323
{
24-
typedef Base* (*createFxn)(Args...);
24+
using createFxn = Base* (*)(Args...);
2525

2626
virtual Base* create(Args... ctorArgs) = 0;
2727

src/sst/core/eli/simpleInfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ class checkForELI_getSimpleInfoFunction
3838
template <typename F, F>
3939
struct check;
4040

41-
typedef char Match;
42-
typedef long NotMatch;
41+
using Match = char;
42+
using NotMatch = long;
4343

44-
typedef const InfoType& (*functionsig)(SimpleInfoPlaceHolder<index, InfoType>);
44+
using functionsig = const InfoType& (*)(SimpleInfoPlaceHolder<index, InfoType>);
4545

4646
template <typename F>
4747
static Match HasFunction(check<functionsig, &F::ELI_getSimpleInfo>*);

src/sst/core/event.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ class Event : public Activity
6767
using Handler2 = SSTHandler2<void, Event*, classT, dataT, funcT>;
6868

6969
/** Type definition of unique identifiers */
70-
typedef std::pair<uint64_t, int> id_type;
70+
using id_type = std::pair<uint64_t, int>;
7171
/** Constant, default value for id_types */
72-
static const id_type NO_ID;
72+
static const id_type NO_ID;
7373

7474
Event() : Activity(), delivery_info(0)
7575
{

src/sst/core/impl/timevortex/timeVortexBinnedMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class TimeVortexBinnedMapBase : public TimeVortex
150150
// for concurrent access.
151151
TimeUnit* current_time_unit;
152152

153-
typedef std::map<SimTime_t, TimeUnit*> mapType_t;
153+
using mapType_t = std::map<SimTime_t, TimeUnit*>;
154154

155155
// Accessed by multiple threads, must be locked when accessing
156156
mapType_t map;

src/sst/core/impl/timevortex/timeVortexPQ.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TimeVortexPQBase : public TimeVortex
5959
virtual void fixup_handlers() override;
6060

6161
private:
62-
typedef std::priority_queue<Activity*, std::vector<Activity*>, Activity::greater<true, true, true>> dataType_t;
62+
using dataType_t = std::priority_queue<Activity*, std::vector<Activity*>, Activity::greater<true, true, true>>;
6363

6464
template <class T, class S, class C>
6565
S& getContainer(std::priority_queue<T, S, C>& q)

src/sst/core/interfaces/simpleNetwork.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ namespace SST::Interfaces {
3838
class SimpleNetwork : public SubComponent
3939
{
4040
public:
41-
SST_ELI_REGISTER_SUBCOMPONENT_API(SST::Interfaces::SimpleNetwork,int)
41+
SST_ELI_REGISTER_SUBCOMPONENT_API(SST::Interfaces::SimpleNetwork, int)
4242

4343
/** All Addresses can be 64-bit */
44-
typedef int64_t nid_t;
44+
using nid_t = int64_t;
4545
#define PRI_NID PRIi64
4646

4747
static const nid_t INIT_BROADCAST_ADDR;
@@ -96,11 +96,11 @@ class SimpleNetwork : public SubComponent
9696
/**
9797
* Trace types
9898
*/
99-
typedef enum {
99+
enum TraceType {
100100
NONE, /*!< No tracing enabled */
101101
ROUTE, /*!< Trace route information only */
102102
FULL /*!< Trace all movements of packets through network */
103-
} TraceType;
103+
};
104104

105105
/** Constructor */
106106
Request() :

src/sst/core/interfaces/stdMem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class StandardMem : public SubComponent
103103
SST_ELI_REGISTER_SUBCOMPONENT_API(SST::Interfaces::StandardMem,TimeConverter*,HandlerBase*)
104104

105105
/** All Addresses can be 64-bit */
106-
typedef uint64_t Addr;
106+
using Addr = uint64_t;
107107
#define PRI_ADDR PRIx64
108108

109109
/**
@@ -112,8 +112,8 @@ class StandardMem : public SubComponent
112112
class Request
113113
{
114114
public:
115-
typedef uint64_t id_t;
116-
typedef uint32_t flags_t;
115+
using id_t = uint64_t;
116+
using flags_t = uint32_t;
117117

118118
/** Flags that modify requests.
119119
* Each bit in a 32-bit field (flags_t) defines a seperate flag.

0 commit comments

Comments
 (0)