Talvos  0.1
SPIR-V interpreter and dynamic analysis framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Public Attributes | Friends | List of all members
talvos::Dim3 Class Reference

Class representing a 3-dimensional size or ID. More...

#include <talvos/Dim3.h>

Public Member Functions

 Dim3 ()
 Construct a Dim3 with values (1,1,1). More...
 
 Dim3 (uint32_t X, uint32_t Y, uint32_t Z)
 Construct a Dim3 from specific values. More...
 
 Dim3 (const uint32_t Data[3])
 Construct a Dim3 from an array. More...
 
Dim3 operator+ (const Dim3 &D) const
 Returns the component-wise addition of this Dim3 with D. More...
 
Dim3 operator* (const Dim3 &D) const
 Returns the component-wise multiplication of this Dim3 with D. More...
 
Dim3 operator% (const Dim3 &D) const
 Returns the component-wise modulus of this Dim3 with D. More...
 
bool operator== (const Dim3 &D) const
 Returns true if this Dim3 is equal to D. More...
 
uint32_t & operator[] (unsigned i)
 Returns a mutable reference to the component at index i (i must be < 3). More...
 
const uint32_t & operator[] (unsigned i) const
 Returns a const reference to the component at index i (i must be < 3). More...
 

Public Attributes

union {
   struct {
      uint32_t   X
 
      uint32_t   Y
 
      uint32_t   Z
 
   } 
 
   uint32_t   Data [3]
 
}; 
 Data members. More...
 

Friends

std::ostream & operator<< (std::ostream &Stream, const Dim3 &D)
 Allow a Dim3 to be inserted into an output stream. More...
 

Detailed Description

Class representing a 3-dimensional size or ID.

Instances of this class provide element access via .{X, Y, Z} notation or via the uint32_t Data[3] member.

Definition at line 22 of file Dim3.h.

Constructor & Destructor Documentation

talvos::Dim3::Dim3 ( )
inline

Construct a Dim3 with values (1,1,1).

Definition at line 36 of file Dim3.h.

talvos::Dim3::Dim3 ( uint32_t  X,
uint32_t  Y,
uint32_t  Z 
)
inline

Construct a Dim3 from specific values.

Definition at line 39 of file Dim3.h.

talvos::Dim3::Dim3 ( const uint32_t  Data[3])
inline

Construct a Dim3 from an array.

Definition at line 42 of file Dim3.h.

Member Function Documentation

Dim3 talvos::Dim3::operator% ( const Dim3 D) const
inline

Returns the component-wise modulus of this Dim3 with D.

Definition at line 51 of file Dim3.h.

Dim3 talvos::Dim3::operator* ( const Dim3 D) const
inline

Returns the component-wise multiplication of this Dim3 with D.

Definition at line 48 of file Dim3.h.

Dim3 talvos::Dim3::operator+ ( const Dim3 D) const
inline

Returns the component-wise addition of this Dim3 with D.

Definition at line 45 of file Dim3.h.

bool talvos::Dim3::operator== ( const Dim3 D) const
inline

Returns true if this Dim3 is equal to D.

Definition at line 54 of file Dim3.h.

uint32_t& talvos::Dim3::operator[] ( unsigned  i)
inline

Returns a mutable reference to the component at index i (i must be < 3).

Definition at line 60 of file Dim3.h.

const uint32_t& talvos::Dim3::operator[] ( unsigned  i) const
inline

Returns a const reference to the component at index i (i must be < 3).

Definition at line 63 of file Dim3.h.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  Stream,
const Dim3 D 
)
friend

Allow a Dim3 to be inserted into an output stream.

Produces the output "(X,Y,Z)".

Definition at line 16 of file Dim3.cpp.

Member Data Documentation

union { ... }

Data members.

uint32_t talvos::Dim3::Data[3]

Definition at line 32 of file Dim3.h.

uint32_t talvos::Dim3::X

Definition at line 30 of file Dim3.h.

uint32_t talvos::Dim3::Y

Definition at line 30 of file Dim3.h.

uint32_t talvos::Dim3::Z

Definition at line 30 of file Dim3.h.