Enums

 

Accessorizer provides a lot of options for working with Enums.

Example: let’s say you have the following enums.

typedef enum {

QVNeuralCenterMessageStatusNotQueued,

QVNeuralCenterMessageStatusWaiting,

QVNeuralCenterMessageStatusRunning,

QVNeuralCenterMessageStatusCompleteSucceeded,

QVNeuralCenterMessageStatusCompleteFailed,

QVNeuralCenterMessageStatusDependencyFailed,

} QVNeuralCenterMessageStatus;

You select the block, invoke the Accessorizer Action Panel service (see Setup), then launch your Action Menu or Action Panel for Enum options.

Case for enums (L) gives you the following allowing you to paste them into your switch-case block.  This is useful when working with an existing typedef enum and you’re adding more values and cases.

case QVNeuralCenterMessageStatusNotQueued:

break;

case QVNeuralCenterMessageStatusWaiting:

break;

case QVNeuralCenterMessageStatusRunning:

break;

case QVNeuralCenterMessageStatusCompleteSucceeded:

break;

case QVNeuralCenterMessageStatusCompleteFailed:

break;

case QVNeuralCenterMessageStatusDependencyFailed:

break;

You can also apply bitmasks on 0 or on 1 on existing enums if you need to set values like the following:

QVNeuralCenterMessageStatusNotQueued = 0,

QVNeuralCenterMessageStatusWaiting = 1,

QVNeuralCenterMessageStatusRunning = 2,

QVNeuralCenterMessageStatusCompleteSucceeded = 4,

QVNeuralCenterMessageStatusCompleteFailed = 8,

QVNeuralCenterMessageStatusDependencyFailed = 16,



QVNeuralCenterMessageStatusNotQueued = 1,

QVNeuralCenterMessageStatusWaiting = 2,

QVNeuralCenterMessageStatusRunning = 4,

QVNeuralCenterMessageStatusCompleteSucceeded = 8,

QVNeuralCenterMessageStatusCompleteFailed = 16,

QVNeuralCenterMessageStatusDependencyFailed = 32,

Create typedef enum... brings up a utility panel allowing you to define the type and the values with an option switch/case block.

Accessorizer creates place-holders for your statements.