KiCad PCB EDA Suite
enum_vector.h File Reference

Go to the source code of this file.

Macros

#define DEFINE_ENUM_VECTOR(enum_name, ...)
 Macro to create const vectors containing enum values to enable easy iteration. More...
 
#define DECLARE_ENUM_VECTOR(class_name, enum_name)   constexpr class_name::enum_name class_name::enum_name##_vector[];
 

Macro Definition Documentation

#define DECLARE_ENUM_VECTOR (   class_name,
  enum_name 
)    constexpr class_name::enum_name class_name::enum_name##_vector[];

Definition at line 43 of file enum_vector.h.

Referenced by SCH_IO_MGR::Save().

#define DEFINE_ENUM_VECTOR (   enum_name,
  ... 
)
Value:
enum enum_name __VA_ARGS__; \
static constexpr enum_name enum_name##_vector[] = __VA_ARGS__;

Macro to create const vectors containing enum values to enable easy iteration.

Usage: [header] class A { DEFINE_ENUM_VECTOR( COLORS, { RED, GREEN, BLUE } ); };

[source] for( auto color : A::COLORS_vector ) { // do sth with color }

DECLARE_ENUM_VECTOR( COLORS );

Definition at line 39 of file enum_vector.h.