Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# $Id$
|
||||
# $HeadURL$
|
||||
# $Author$
|
||||
#
|
||||
|
||||
ADD_INTERFACE_LIBRARY(
|
||||
ProjectConfig
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/project_defines.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
)
|
||||
Executable
+84
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Project Defines
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <ostream>
|
||||
|
||||
namespace IDL
|
||||
{
|
||||
enum class PartitionType
|
||||
{
|
||||
Any, // '*'
|
||||
Global, // 'ex_0'
|
||||
Exercise, // 'ex_N'
|
||||
AllExercises, // 'ex_*'
|
||||
Replay, // 'srp_N'
|
||||
};
|
||||
|
||||
inline std::string toStdString(PartitionType pt)
|
||||
{
|
||||
switch (pt)
|
||||
{
|
||||
case PartitionType::Any:
|
||||
return "Any";
|
||||
case PartitionType::Global:
|
||||
return "Global";
|
||||
case PartitionType::Exercise:
|
||||
return "Exercise";
|
||||
case PartitionType::AllExercises:
|
||||
return "AllExercises";
|
||||
case PartitionType::Replay:
|
||||
return "Replay";
|
||||
}
|
||||
return std::string("invalid:") + std::to_string(static_cast<int>(pt));
|
||||
}
|
||||
|
||||
inline std::ostream& operator <<(std::ostream &o, PartitionType pt)
|
||||
{
|
||||
|
||||
switch (pt)
|
||||
{
|
||||
case PartitionType::Any:
|
||||
case PartitionType::Global:
|
||||
case PartitionType::Exercise:
|
||||
case PartitionType::AllExercises:
|
||||
case PartitionType::Replay:
|
||||
return o << std::string("PartitionType::") + toStdString(pt);
|
||||
default:
|
||||
return o << std::to_string(static_cast<int>(pt));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* return a string for an exercise partition
|
||||
* --> exercisePartitionPrefix() + std::to_string(exerciseId)
|
||||
* when exercise id is < 0, exercisePartitionPrefix() + '*' is returned
|
||||
*/
|
||||
inline std::string exercisePartition(int exerciseId)
|
||||
{
|
||||
if (exerciseId < 0)
|
||||
return { "ex_*" };
|
||||
return std::string("ex_") + std::to_string(exerciseId);
|
||||
}
|
||||
|
||||
/**
|
||||
* return a string for an replay partition
|
||||
* --> replayPartitionPrefix() + std::to_string(partitionId)
|
||||
* when partitionId id is < 0, replayPartitionPrefix() + '*' is returned
|
||||
*/
|
||||
inline std::string replayPartition(int partitionId)
|
||||
{
|
||||
if (partitionId < 0)
|
||||
return { "srp_*" };
|
||||
return std::string("srp_") + std::to_string(partitionId);
|
||||
}
|
||||
|
||||
} // Namespace IDL
|
||||
|
||||
Reference in new issue
Block a user