MCPcopy Create free account
hub / github.com/EricLengyel/Terathon-Math-Library / Component

Class Component

TSAlgebra.h:24–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22{
23 template <typename type_struct, int count, int index>
24 class Component
25 {
26 public:
27
28 typedef typename type_struct::component_type component_type;
29
30 component_type data[count];
31
32 operator component_type&(void)
33 {
34 return (data[index]);
35 }
36
37 operator const component_type&(void) const
38 {
39 return (data[index]);
40 }
41
42 operator volatile component_type&(void) volatile
43 {
44 return (data[index]);
45 }
46
47 operator const volatile component_type&(void) const volatile
48 {
49 return (data[index]);
50 }
51
52 component_type *operator &(void)
53 {
54 return (&data[index]);
55 }
56
57 const component_type *operator &(void) const
58 {
59 return (&data[index]);
60 }
61
62 volatile component_type *operator &(void) volatile
63 {
64 return (&data[index]);
65 }
66
67 const volatile component_type *operator &(void) const volatile
68 {
69 return (&data[index]);
70 }
71
72 Component& operator =(const component_type& value)
73 {
74 data[index] = value;
75 return (*this);
76 }
77
78 void operator =(const component_type& value) volatile
79 {
80 data[index] = value;
81 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected