Skip to content

Commit 58c014d

Browse files
committed
[ReadoutCard] Repo-wide force of clang-format
1 parent 67c32a5 commit 58c014d

File tree

87 files changed

+6413
-6236
lines changed

Some content is hidden

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

87 files changed

+6413
-6236
lines changed

include/ReadoutCard/BarInterface.h

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
#include "ReadoutCard/Parameters.h"
2323
#include "boost/optional.hpp"
2424

25-
namespace AliceO2 {
26-
namespace roc {
25+
namespace AliceO2
26+
{
27+
namespace roc
28+
{
2729

2830
/// Provides access to a BAR of a readout card.
2931
///
@@ -33,46 +35,46 @@ namespace roc {
3335
/// Access to 'dangerous' registers may be restricted: UnsafeReadAccess and UnsafeWriteAccess exceptions may be thrown.
3436
///
3537
/// To instantiate an implementation, use the ChannelFactory::getBar() method.
36-
class BarInterface: public virtual RegisterReadWriteInterface
38+
class BarInterface : public virtual RegisterReadWriteInterface
3739
{
38-
public:
39-
virtual ~BarInterface()
40-
{
41-
}
40+
public:
41+
virtual ~BarInterface()
42+
{
43+
}
44+
45+
/// Get the index of this BAR
46+
virtual int getIndex() const = 0;
47+
48+
/// Get the size of this BAR in bytes
49+
virtual size_t getSize() const = 0;
50+
51+
/// Returns the type of the card
52+
/// \return The card type
53+
virtual CardType::type getCardType() = 0;
54+
55+
virtual boost::optional<int32_t> getSerial() = 0;
56+
57+
virtual boost::optional<float> getTemperature() = 0;
4258

43-
/// Get the index of this BAR
44-
virtual int getIndex() const = 0;
59+
virtual boost::optional<std::string> getFirmwareInfo() = 0;
4560

46-
/// Get the size of this BAR in bytes
47-
virtual size_t getSize() const = 0;
61+
virtual boost::optional<std::string> getCardId() = 0;
4862

49-
/// Returns the type of the card
50-
/// \return The card type
51-
virtual CardType::type getCardType() = 0;
63+
virtual int32_t getDroppedPackets(int endpoint) = 0;
5264

53-
virtual boost::optional<int32_t> getSerial() = 0;
65+
virtual uint32_t getCTPClock() = 0;
5466

55-
virtual boost::optional<float> getTemperature() = 0;
67+
virtual uint32_t getLocalClock() = 0;
5668

57-
virtual boost::optional<std::string> getFirmwareInfo() = 0;
69+
virtual int32_t getLinks() = 0;
5870

59-
virtual boost::optional<std::string> getCardId() = 0;
60-
61-
virtual int32_t getDroppedPackets(int endpoint) = 0;
62-
63-
virtual uint32_t getCTPClock() = 0;
64-
65-
virtual uint32_t getLocalClock() = 0;
71+
virtual int32_t getLinksPerWrapper(int wrapper) = 0;
6672

67-
virtual int32_t getLinks() = 0;
73+
virtual int getEndpointNumber() = 0;
6874

69-
virtual int32_t getLinksPerWrapper(int wrapper) = 0;
75+
virtual void configure() = 0;
7076

71-
virtual int getEndpointNumber() = 0;
72-
73-
virtual void configure() = 0;
74-
75-
virtual void reconfigure() = 0;
77+
virtual void reconfigure() = 0;
7678
};
7779

7880
} // namespace roc

include/ReadoutCard/CardConfigurator.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,31 @@
99
// or submit itself to any jurisdiction.
1010

1111
/// \file CardConfigurator.h
12-
/// \brief Definition of the CardConfigurator class.
12+
/// \brief Definition of the CardConfigurator class.
1313
///
1414
/// \author Kostas Alexopoulos ([email protected])
1515

16-
1716
#ifndef ALICEO2_SRC_READOUTCARD_CARDCONFIGURATOR_H_
1817
#define ALICEO2_SRC_READOUTCARD_CARDCONFIGURATOR_H_
1918

2019
#include "ReadoutCard/Parameters.h"
2120

22-
namespace AliceO2 {
23-
namespace roc {
21+
namespace AliceO2
22+
{
23+
namespace roc
24+
{
2425

2526
class CardConfigurator
2627
{
27-
public:
28-
CardConfigurator(Parameters::CardIdType cardId, std::string pathToConfigFile, bool forceConfigure=false);
29-
CardConfigurator(Parameters& parameters, bool forceConfigure=false);
28+
public:
29+
CardConfigurator(Parameters::CardIdType cardId, std::string pathToConfigFile, bool forceConfigure = false);
30+
CardConfigurator(Parameters& parameters, bool forceConfigure = false);
3031

31-
private:
32-
void parseConfigFile(std::string pathToConfigFile, Parameters& parameters);
32+
private:
33+
void parseConfigFile(std::string pathToConfigFile, Parameters& parameters);
3334
};
3435

35-
} // namespace AliceO2
3636
} // namespace roc
37+
} // namespace AliceO2
3738

3839
#endif // ALICEO2_SRC_READOUTCARD_CARDCONFIGURATOR_H_

include/ReadoutCard/CardType.h

Lines changed: 44 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,72 +8,80 @@
88

99
#include <string>
1010

11-
namespace AliceO2 {
12-
namespace roc {
11+
namespace AliceO2
12+
{
13+
namespace roc
14+
{
1315

1416
/// Namespace for enum describing a RORC card type, and supporting functions
15-
struct CardType
16-
{
17-
enum type
18-
{
19-
Unknown, ///< Unknown card type
20-
Crorc, ///< C-RORC card type
21-
Cru, ///< CRU card type
22-
Dummy ///< Dummy card type
23-
};
17+
struct CardType {
18+
enum type {
19+
Unknown, ///< Unknown card type
20+
Crorc, ///< C-RORC card type
21+
Cru, ///< CRU card type
22+
Dummy ///< Dummy card type
23+
};
2424

25-
/// Converts a CardType to a string
26-
static std::string toString(const CardType::type& type);
25+
/// Converts a CardType to a string
26+
static std::string toString(const CardType::type& type);
2727

28-
/// Converts a string to a CardType
29-
static CardType::type fromString(const std::string& string);
28+
/// Converts a string to a CardType
29+
static CardType::type fromString(const std::string& string);
3030
};
3131

3232
/// Namespace for type tags that refer to CardType enum values. Provided for use in templates.
3333
namespace CardTypeTag
3434
{
35-
constexpr struct DummyTag_ { static constexpr auto type = CardType::Dummy; } DummyTag = {};
36-
constexpr struct CrorcTag_ { static constexpr auto type = CardType::Crorc; } CrorcTag = {};
37-
constexpr struct CruTag_ { static constexpr auto type = CardType::Cru; } CruTag = {};
38-
constexpr struct UnknownTag_ { static constexpr auto type = CardType::Unknown; } UnknownTag = {};
35+
constexpr struct DummyTag_ {
36+
static constexpr auto type = CardType::Dummy;
37+
} DummyTag = {};
38+
constexpr struct CrorcTag_ {
39+
static constexpr auto type = CardType::Crorc;
40+
} CrorcTag = {};
41+
constexpr struct CruTag_ {
42+
static constexpr auto type = CardType::Cru;
43+
} CruTag = {};
44+
constexpr struct UnknownTag_ {
45+
static constexpr auto type = CardType::Unknown;
46+
} UnknownTag = {};
3947

4048
/// Checks if the given tag represents a valid card type.
4149
/// This means the type needs to be a DummyTag_ CrorcTag_ or CruTag_. NOT UnknownTag_ or anything else.
42-
template<class Tag>
50+
template <class Tag>
4351
constexpr bool isValidTag()
4452
{
45-
// To make the comparison simpler, we strip Tag of cv-qualifiers and references
46-
using tag = typename std::decay<Tag>::type;
47-
return std::is_same<tag, CardTypeTag::DummyTag_>::value ||
48-
std::is_same<tag, CardTypeTag::CrorcTag_>::value ||
49-
std::is_same<tag, CardTypeTag::CruTag_>::value;
53+
// To make the comparison simpler, we strip Tag of cv-qualifiers and references
54+
using tag = typename std::decay<Tag>::type;
55+
return std::is_same<tag, CardTypeTag::DummyTag_>::value ||
56+
std::is_same<tag, CardTypeTag::CrorcTag_>::value ||
57+
std::is_same<tag, CardTypeTag::CruTag_>::value;
5058
}
5159

5260
/// Checks if the given tag represents a valid card type
5361
/// Overload that deduces the type from the parameter; see non-parameterized version for more details.
54-
template<class Tag>
62+
template <class Tag>
5563
constexpr bool isValidTag(Tag)
5664
{
5765
return isValidTag<Tag>();
5866
}
5967

6068
/// Checks if the given tag represents a non-dummy card type.
61-
template<class Tag>
69+
template <class Tag>
6270
constexpr bool isNonDummyTag()
6371
{
64-
// To make the comparison simpler, we strip Tag of cv-qualifiers and references
65-
using tag = typename std::decay<Tag>::type;
66-
return std::is_same<tag, CardTypeTag::CrorcTag_>::value ||
67-
std::is_same<tag, CardTypeTag::CruTag_>::value;
72+
// To make the comparison simpler, we strip Tag of cv-qualifiers and references
73+
using tag = typename std::decay<Tag>::type;
74+
return std::is_same<tag, CardTypeTag::CrorcTag_>::value ||
75+
std::is_same<tag, CardTypeTag::CruTag_>::value;
6876
}
69-
77+
7078
/// Checks if the given tag represents a dummy card type
71-
template<class Tag>
79+
template <class Tag>
7280
constexpr bool isDummyTag()
7381
{
74-
// To make the comparison simpler, we strip Tag of cv-qualifiers and references
75-
using tag = typename std::decay<Tag>::type;
76-
return std::is_same<tag, CardTypeTag::DummyTag_>::value;
82+
// To make the comparison simpler, we strip Tag of cv-qualifiers and references
83+
using tag = typename std::decay<Tag>::type;
84+
return std::is_same<tag, CardTypeTag::DummyTag_>::value;
7785
}
7886

7987
static_assert(isValidTag<DummyTag_>() && isValidTag(DummyTag), "");

include/ReadoutCard/ChannelFactory.h

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,50 @@
1616
#ifndef ALICEO2_INCLUDE_READOUTCARD_CHANNELFACTORY_H_
1717
#define ALICEO2_INCLUDE_READOUTCARD_CHANNELFACTORY_H_
1818

19-
2019
#include "ReadoutCard/Parameters.h"
2120
#include <memory>
2221
#include <string>
2322
#include "ReadoutCard/DmaChannelInterface.h"
2423
#include "ReadoutCard/BarInterface.h"
2524

26-
namespace AliceO2 {
27-
namespace roc {
25+
namespace AliceO2
26+
{
27+
namespace roc
28+
{
2829

2930
/// Factory class for creating objects to access and control card channels
3031
class ChannelFactory
3132
{
32-
public:
33-
using DmaChannelSharedPtr = std::shared_ptr<DmaChannelInterface>;
34-
using BarSharedPtr = std::shared_ptr<BarInterface>;
33+
public:
34+
using DmaChannelSharedPtr = std::shared_ptr<DmaChannelInterface>;
35+
using BarSharedPtr = std::shared_ptr<BarInterface>;
3536

36-
ChannelFactory();
37-
virtual ~ChannelFactory();
37+
ChannelFactory();
38+
virtual ~ChannelFactory();
3839

39-
/// Get an object to access a DMA channel with the given serial number and channel number.
40-
/// Passing 'DUMMY_SERIAL_NUMBER' as serial number returns a dummy implementation
41-
/// \param parameters Parameters for the channel
42-
DmaChannelSharedPtr getDmaChannel(const Parameters &parameters);
40+
/// Get an object to access a DMA channel with the given serial number and channel number.
41+
/// Passing 'DUMMY_SERIAL_NUMBER' as serial number returns a dummy implementation
42+
/// \param parameters Parameters for the channel
43+
DmaChannelSharedPtr getDmaChannel(const Parameters& parameters);
4344

44-
/// Get an object to access a BAR with the given card ID and channel number.
45-
/// Passing 'DUMMY_SERIAL_NUMBER' as serial number returns a dummy implementation
46-
/// \param parameters Parameters for the channel
47-
BarSharedPtr getBar(const Parameters &parameters);
45+
/// Get an object to access a BAR with the given card ID and channel number.
46+
/// Passing 'DUMMY_SERIAL_NUMBER' as serial number returns a dummy implementation
47+
/// \param parameters Parameters for the channel
48+
BarSharedPtr getBar(const Parameters& parameters);
4849

49-
/// Get an object to access a BAR with the given card ID and channel number.
50-
/// Passing 'DUMMY_SERIAL_NUMBER' as serial number returns a dummy implementation
51-
/// \param cardId ID of the card
52-
/// \param channel Channel number to open
53-
BarSharedPtr getBar(const Parameters::CardIdType& cardId, const Parameters::ChannelNumberType& channel)
54-
{
55-
return getBar(Parameters::makeParameters(cardId, channel));
56-
}
50+
/// Get an object to access a BAR with the given card ID and channel number.
51+
/// Passing 'DUMMY_SERIAL_NUMBER' as serial number returns a dummy implementation
52+
/// \param cardId ID of the card
53+
/// \param channel Channel number to open
54+
BarSharedPtr getBar(const Parameters::CardIdType& cardId, const Parameters::ChannelNumberType& channel)
55+
{
56+
return getBar(Parameters::makeParameters(cardId, channel));
57+
}
5758

58-
static int getDummySerialNumber()
59-
{
60-
return -1;
61-
}
59+
static int getDummySerialNumber()
60+
{
61+
return -1;
62+
}
6263
};
6364

6465
} // namespace roc

include/ReadoutCard/Cru.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818

1919
#include <cstdint>
2020

21-
namespace AliceO2 {
22-
namespace roc {
23-
namespace Cru {
21+
namespace AliceO2
22+
{
23+
namespace roc
24+
{
25+
namespace Cru
26+
{
2427

2528
static constexpr uint32_t CLOCK_TTC(0x0);
2629
static constexpr uint32_t CLOCK_LOCAL(0x2);

0 commit comments

Comments
 (0)