Continues migration with DDS, Common
This commit is contained in:
1 parent
9b15cee841
commit
fa48db111e
668 files changed
+111841
-2
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
+73
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <ostream>
|
||||
|
||||
namespace IDL
|
||||
{
|
||||
enum class PartitionType
|
||||
{
|
||||
Any,
|
||||
Global,
|
||||
Exercise,
|
||||
AllExercises,
|
||||
Replay,
|
||||
};
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline std::string exercisePartition(int exerciseId)
|
||||
{
|
||||
if (exerciseId < 0)
|
||||
return { "ex_*" };
|
||||
return std::string("ex_") + std::to_string(exerciseId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline std::string replayPartition(int partitionId)
|
||||
{
|
||||
if (partitionId < 0)
|
||||
return { "srp_*" };
|
||||
return std::string("srp_") + std::to_string(partitionId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user