Empirical
Public Types | Public Member Functions | Public Attributes | List of all members
emp::Instruction< ARG_COUNT, ARG_TYPE > Struct Template Reference

A single instruction in a linear genome. More...

#include <LinearCode.h>

Public Types

using args_t = emp::array< ARG_TYPE, ARG_COUNT >
 

Public Member Functions

 Instruction (size_t _id=0, const args_t &in_args={})
 
 Instruction (const Instruction &)=default
 
 Instruction (Instruction &&)=default
 
Instructionoperator= (const Instruction &)=default
 Copy operator. More...
 
Instructionoperator= (Instruction &&)=default
 Move operator. More...
 
bool operator< (const Instruction &other) const
 Test if this instruction is less than another. More...
 
void Set (size_t _id, const args_t &in_args)
 Explicitly set the instruction type and specific arguments for this instruction. More...
 
bool operator== (const Instruction &in) const
 Test if this instruction is identical to another. More...
 

Public Attributes

size_t id
 Unique value identifying which instruction this is. More...
 
args_t args
 A set of arguments defining the specific behavior of this instruction. More...
 

Detailed Description

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
struct emp::Instruction< ARG_COUNT, ARG_TYPE >

A single instruction in a linear genome.

Member Typedef Documentation

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
using emp::Instruction< ARG_COUNT, ARG_TYPE >::args_t = emp::array<ARG_TYPE, ARG_COUNT>

Constructor & Destructor Documentation

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
emp::Instruction< ARG_COUNT, ARG_TYPE >::Instruction ( size_t  _id = 0,
const args_t in_args = {} 
)
inline
template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
emp::Instruction< ARG_COUNT, ARG_TYPE >::Instruction ( const Instruction< ARG_COUNT, ARG_TYPE > &  )
default
template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
emp::Instruction< ARG_COUNT, ARG_TYPE >::Instruction ( Instruction< ARG_COUNT, ARG_TYPE > &&  )
default

Member Function Documentation

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
bool emp::Instruction< ARG_COUNT, ARG_TYPE >::operator< ( const Instruction< ARG_COUNT, ARG_TYPE > &  other) const
inline

Test if this instruction is less than another.

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
Instruction& emp::Instruction< ARG_COUNT, ARG_TYPE >::operator= ( const Instruction< ARG_COUNT, ARG_TYPE > &  )
default

Copy operator.

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
Instruction& emp::Instruction< ARG_COUNT, ARG_TYPE >::operator= ( Instruction< ARG_COUNT, ARG_TYPE > &&  )
default

Move operator.

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
bool emp::Instruction< ARG_COUNT, ARG_TYPE >::operator== ( const Instruction< ARG_COUNT, ARG_TYPE > &  in) const
inline

Test if this instruction is identical to another.

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
void emp::Instruction< ARG_COUNT, ARG_TYPE >::Set ( size_t  _id,
const args_t in_args 
)
inline

Explicitly set the instruction type and specific arguments for this instruction.

Member Data Documentation

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
args_t emp::Instruction< ARG_COUNT, ARG_TYPE >::args

A set of arguments defining the specific behavior of this instruction.

template<size_t ARG_COUNT, typename ARG_TYPE = size_t>
size_t emp::Instruction< ARG_COUNT, ARG_TYPE >::id

Unique value identifying which instruction this is.


The documentation for this struct was generated from the following file: