1 #pragma once 2 #include <nlohmann/json.hpp> 3 4 namespace physical_context 5 { 6 // clang-format off 7 8 enum class PhysicalContext{ 9 Invalid, 10 Room, 11 Intake, 12 Exhaust, 13 LiquidInlet, 14 LiquidOutlet, 15 Front, 16 Back, 17 Upper, 18 Lower, 19 CPU, 20 CPUSubsystem, 21 GPU, 22 GPUSubsystem, 23 FPGA, 24 Accelerator, 25 ASIC, 26 Backplane, 27 SystemBoard, 28 PowerSupply, 29 PowerSubsystem, 30 VoltageRegulator, 31 Rectifier, 32 StorageDevice, 33 NetworkingDevice, 34 ComputeBay, 35 StorageBay, 36 NetworkBay, 37 ExpansionBay, 38 PowerSupplyBay, 39 Memory, 40 MemorySubsystem, 41 Chassis, 42 Fan, 43 CoolingSubsystem, 44 Motor, 45 Transformer, 46 ACUtilityInput, 47 ACStaticBypassInput, 48 ACMaintenanceBypassInput, 49 DCBus, 50 ACOutput, 51 ACInput, 52 TrustedModule, 53 Board, 54 Transceiver, 55 Battery, 56 Pump, 57 }; 58 59 enum class PhysicalSubContext{ 60 Invalid, 61 Input, 62 Output, 63 }; 64 65 enum class LogicalContext{ 66 Invalid, 67 Capacity, 68 Environment, 69 Network, 70 Performance, 71 Security, 72 Storage, 73 }; 74 75 NLOHMANN_JSON_SERIALIZE_ENUM(PhysicalContext, { 76 {PhysicalContext::Invalid, "Invalid"}, 77 {PhysicalContext::Room, "Room"}, 78 {PhysicalContext::Intake, "Intake"}, 79 {PhysicalContext::Exhaust, "Exhaust"}, 80 {PhysicalContext::LiquidInlet, "LiquidInlet"}, 81 {PhysicalContext::LiquidOutlet, "LiquidOutlet"}, 82 {PhysicalContext::Front, "Front"}, 83 {PhysicalContext::Back, "Back"}, 84 {PhysicalContext::Upper, "Upper"}, 85 {PhysicalContext::Lower, "Lower"}, 86 {PhysicalContext::CPU, "CPU"}, 87 {PhysicalContext::CPUSubsystem, "CPUSubsystem"}, 88 {PhysicalContext::GPU, "GPU"}, 89 {PhysicalContext::GPUSubsystem, "GPUSubsystem"}, 90 {PhysicalContext::FPGA, "FPGA"}, 91 {PhysicalContext::Accelerator, "Accelerator"}, 92 {PhysicalContext::ASIC, "ASIC"}, 93 {PhysicalContext::Backplane, "Backplane"}, 94 {PhysicalContext::SystemBoard, "SystemBoard"}, 95 {PhysicalContext::PowerSupply, "PowerSupply"}, 96 {PhysicalContext::PowerSubsystem, "PowerSubsystem"}, 97 {PhysicalContext::VoltageRegulator, "VoltageRegulator"}, 98 {PhysicalContext::Rectifier, "Rectifier"}, 99 {PhysicalContext::StorageDevice, "StorageDevice"}, 100 {PhysicalContext::NetworkingDevice, "NetworkingDevice"}, 101 {PhysicalContext::ComputeBay, "ComputeBay"}, 102 {PhysicalContext::StorageBay, "StorageBay"}, 103 {PhysicalContext::NetworkBay, "NetworkBay"}, 104 {PhysicalContext::ExpansionBay, "ExpansionBay"}, 105 {PhysicalContext::PowerSupplyBay, "PowerSupplyBay"}, 106 {PhysicalContext::Memory, "Memory"}, 107 {PhysicalContext::MemorySubsystem, "MemorySubsystem"}, 108 {PhysicalContext::Chassis, "Chassis"}, 109 {PhysicalContext::Fan, "Fan"}, 110 {PhysicalContext::CoolingSubsystem, "CoolingSubsystem"}, 111 {PhysicalContext::Motor, "Motor"}, 112 {PhysicalContext::Transformer, "Transformer"}, 113 {PhysicalContext::ACUtilityInput, "ACUtilityInput"}, 114 {PhysicalContext::ACStaticBypassInput, "ACStaticBypassInput"}, 115 {PhysicalContext::ACMaintenanceBypassInput, "ACMaintenanceBypassInput"}, 116 {PhysicalContext::DCBus, "DCBus"}, 117 {PhysicalContext::ACOutput, "ACOutput"}, 118 {PhysicalContext::ACInput, "ACInput"}, 119 {PhysicalContext::TrustedModule, "TrustedModule"}, 120 {PhysicalContext::Board, "Board"}, 121 {PhysicalContext::Transceiver, "Transceiver"}, 122 {PhysicalContext::Battery, "Battery"}, 123 {PhysicalContext::Pump, "Pump"}, 124 }); 125 126 NLOHMANN_JSON_SERIALIZE_ENUM(PhysicalSubContext, { 127 {PhysicalSubContext::Invalid, "Invalid"}, 128 {PhysicalSubContext::Input, "Input"}, 129 {PhysicalSubContext::Output, "Output"}, 130 }); 131 132 NLOHMANN_JSON_SERIALIZE_ENUM(LogicalContext, { 133 {LogicalContext::Invalid, "Invalid"}, 134 {LogicalContext::Capacity, "Capacity"}, 135 {LogicalContext::Environment, "Environment"}, 136 {LogicalContext::Network, "Network"}, 137 {LogicalContext::Performance, "Performance"}, 138 {LogicalContext::Security, "Security"}, 139 {LogicalContext::Storage, "Storage"}, 140 }); 141 142 } 143 // clang-format on 144