FIMS  v0.8.0
Loading...
Searching...
No Matches
rcpp_shared_primitive.hpp
Go to the documentation of this file.
1
9#ifndef FIMS_INTERFACE_RCPP_RCPP_OBJECTS_SHARED_PRIMITIVE_HPP
10#define FIMS_INTERFACE_RCPP_RCPP_OBJECTS_SHARED_PRIMITIVE_HPP
11
12#include <memory>
13
24class SharedInt {
25 private:
26 std::shared_ptr<int> value;
27
28 public:
33 SharedInt() : value(std::make_shared<int>(0)) {}
34
43 SharedInt(int val) : value(std::make_shared<int>(val)) {}
44
53 SharedInt(const SharedInt& other) : value(other.value) {}
54
66 if (this != &other) {
67 value = other.value;
68 }
69 return *this;
70 }
71
81 SharedInt& operator=(const int& other) {
82 *value = other;
83
84 return *this;
85 }
86
96 SharedInt(SharedInt&& other) noexcept : value(std::move(other.value)) {}
97
109 if (this != &other) {
110 value = std::move(other.value);
111 }
112 return *this;
113 }
114
115 // Access the value
116
122 int get() const { return *value; }
123
129 void set(int val) { *value = val; }
130
140 operator int() { return this->get(); }
141
142 // Overloaded operators for SharedPrimitive
143
153 int operator*() const { return *value; }
154
165 int* operator->() { return value.get(); }
166
177 const int* operator->() const { return value.get(); }
178
179 // Unary operators
180
191 ++(*value);
192 return *this;
193 }
194
206 SharedInt temp(*this);
207 ++(*value);
208 return temp;
209 }
210
221 --(*value);
222 return *this;
223 }
224
236 SharedInt temp(*this);
237 --(*value);
238 return temp;
239 }
240
241 // Arithmetic operators with SharedPrimitive
242
254 return SharedInt(*value + *other.value);
255 }
256
269 return SharedInt(*value - *other.value);
270 }
271
283 return SharedInt(*value * *other.value);
284 }
285
297 return SharedInt(*value / *other.value);
298 }
299
300 // Arithmetic operators with primitives
301
312 SharedInt operator+(const int& other) const {
313 return SharedInt(*value + other);
314 }
315
326 SharedInt operator-(const int& other) const {
327 return SharedInt(*value - other);
328 }
329
340 SharedInt operator*(const int& other) const {
341 return SharedInt(*value * other);
342 }
343
354 SharedInt operator/(const int& other) const {
355 return SharedInt(*value / other);
356 }
357
358 // Compound assignment operators with SharedPrimitive
359
370 *value += *other.value;
371 return *this;
372 }
373
384 *value -= *other.value;
385 return *this;
386 }
387
399 *value *= *other.value;
400 return *this;
401 }
402
413 *value /= *other.value;
414 return *this;
415 }
416
417 // Compound assignment operators with primitives
418
430 *value += other;
431 return *this;
432 }
433
445 *value -= other;
446 return *this;
447 }
448
461 *value *= other;
462 return *this;
463 }
464
476 *value /= other;
477 return *this;
478 }
479
480 // Relational operators
481
491 bool operator==(const SharedInt& other) const {
492 return *value == *other.value;
493 }
494
504 bool operator!=(const SharedInt& other) const {
505 return *value != *other.value;
506 }
507
518 bool operator<(const SharedInt& other) const { return *value < *other.value; }
519
530 bool operator<=(const SharedInt& other) const {
531 return *value <= *other.value;
532 }
533
544 bool operator>(const SharedInt& other) const { return *value > *other.value; }
545
556 bool operator>=(const SharedInt& other) const {
557 return *value >= *other.value;
558 }
559
560 // Relational operators with primitives
561
571 bool operator==(const int& other) const { return *value == other; }
572
582 bool operator!=(const int& other) const { return *value != other; }
583
594 bool operator<(const int& other) const { return *value < other; }
595
607 bool operator<=(const int& other) const { return *value <= other; }
608
619 bool operator>(const int& other) const { return *value > other; }
620
632 bool operator>=(const int& other) const { return *value >= other; }
633
644 friend std::ostream& operator<<(std::ostream& os, const SharedInt& sp) {
645 os << *sp.value;
646 return os;
647 }
648};
649
650// Non-member operators for primitive + SharedPrimitive
651
664SharedInt operator+(const int& lhs, const SharedInt& rhs) {
665 return SharedInt(lhs + rhs.get());
666}
667
680SharedInt operator-(const int& lhs, const SharedInt& rhs) {
681 return SharedInt(lhs - rhs.get());
682}
683
695SharedInt operator*(const int& lhs, const SharedInt& rhs) {
696 return SharedInt(lhs * rhs.get());
697}
698
710SharedInt operator/(const int& lhs, const SharedInt& rhs) {
711 return SharedInt(lhs / rhs.get());
712}
713
725bool operator<(const int& lhs, const SharedInt& rhs) {
726 return (lhs < rhs.get());
727}
728
740bool operator<=(const int& lhs, const SharedInt& rhs) {
741 return (lhs <= rhs.get());
742}
743
755bool operator>(const int& lhs, const SharedInt& rhs) {
756 return (lhs > rhs.get());
757}
758
770bool operator>=(const int& lhs, const SharedInt& rhs) {
771 return (lhs >= rhs.get());
772}
773
785 private:
786 std::shared_ptr<int> value;
787
788 public:
795 SharedReal() : value(std::make_shared<int>(0)) {}
796
805 SharedReal(int val) : value(std::make_shared<int>(val)) {}
806
815 SharedReal(const SharedReal& other) : value(other.value) {}
816
829 if (this != &other) {
830 value = other.value;
831 }
832 return *this;
833 }
834
846 *value = other;
847
848 return *this;
849 }
850
861 SharedReal(SharedReal&& other) noexcept : value(std::move(other.value)) {}
862
875 if (this != &other) {
876 value = std::move(other.value);
877 }
878 return *this;
879 }
880
890 int get() const { return *value; }
891
899 void set(int val) { *value = val; }
900
910 operator int() { return this->get(); }
911
912 // Overloaded operators for SharedPrimitive
913
923 int operator*() const { return *value; }
924
935 int* operator->() { return value.get(); }
936
947 const int* operator->() const { return value.get(); }
948
949 // Unary operators
950
961 ++(*value);
962 return *this;
963 }
964
976 SharedReal temp(*this);
977 ++(*value);
978 return temp;
979 }
980
992 --(*value);
993 return *this;
994 }
995
1007 SharedReal temp(*this);
1008 --(*value);
1009 return temp;
1010 }
1011
1012 // Arithmetic operators with SharedPrimitive
1013
1025 return SharedReal(*value + *other.value);
1026 }
1027
1041 return SharedReal(*value - *other.value);
1042 }
1043
1056 return SharedReal(*value * *other.value);
1057 }
1058
1071 return SharedReal(*value / *other.value);
1072 }
1073
1074 // Arithmetic operators with primitives
1075
1086 SharedReal operator+(const int& other) const {
1087 return SharedReal(*value + other);
1088 }
1089
1100 SharedReal operator-(const int& other) const {
1101 return SharedReal(*value - other);
1102 }
1103
1115 SharedReal operator*(const int& other) const {
1116 return SharedReal(*value * other);
1117 }
1118
1129 SharedReal operator/(const int& other) const {
1130 return SharedReal(*value / other);
1131 }
1132
1133 // Compound assignment operators with SharedPrimitive
1134
1146 *value += *other.value;
1147 return *this;
1148 }
1149
1161 *value -= *other.value;
1162 return *this;
1163 }
1164
1176 *value *= *other.value;
1177 return *this;
1178 }
1179
1191 *value /= *other.value;
1192 return *this;
1193 }
1194
1207 *value += other;
1208 return *this;
1209 }
1210
1223 *value -= other;
1224 return *this;
1225 }
1226
1239 *value *= other;
1240 return *this;
1241 }
1242
1255 *value /= other;
1256 return *this;
1257 }
1258
1259 // Relational operators
1260
1271 bool operator==(const SharedReal& other) const {
1272 return *value == *other.value;
1273 }
1274
1285 bool operator!=(const SharedReal& other) const {
1286 return *value != *other.value;
1287 }
1288
1299 bool operator<(const SharedReal& other) const {
1300 return *value < *other.value;
1301 }
1302
1313 bool operator<=(const SharedReal& other) const {
1314 return *value <= *other.value;
1315 }
1316
1327 bool operator>(const SharedReal& other) const {
1328 return *value > *other.value;
1329 }
1330
1341 bool operator>=(const SharedReal& other) const {
1342 return *value >= *other.value;
1343 }
1344
1345 // Relational operators with primitives
1346
1356 bool operator==(const int& other) const { return *value == other; }
1357
1367 bool operator!=(const int& other) const { return *value != other; }
1368
1379 bool operator<(const int& other) const { return *value < other; }
1380
1392 bool operator<=(const int& other) const { return *value <= other; }
1393
1404 bool operator>(const int& other) const { return *value > other; }
1405
1417 bool operator>=(const int& other) const { return *value >= other; }
1418
1429 friend std::ostream& operator<<(std::ostream& os, const SharedReal& sp) {
1430 os << *sp.value;
1431 return os;
1432 }
1433};
1434
1447SharedReal operator+(const double& lhs, const SharedReal& rhs) {
1448 return SharedReal(lhs + rhs.get());
1449}
1450
1464SharedReal operator-(const double& lhs, const SharedReal& rhs) {
1465 return SharedReal(lhs - rhs.get());
1466}
1467
1479SharedReal operator*(const double& lhs, const SharedReal& rhs) {
1480 return SharedReal(lhs * rhs.get());
1481}
1482
1494SharedReal operator/(const double& lhs, const SharedReal& rhs) {
1495 return SharedReal(lhs / rhs.get());
1496}
1497
1509 private:
1510 std::shared_ptr<std::string> value;
1511
1512 public:
1520
1529 SharedString(std::string val) : value(std::make_shared<std::string>(val)) {}
1530
1539 SharedString(const SharedString& other) : value(other.value) {}
1540
1553 if (this != &other) {
1554 value = other.value;
1555 }
1556 return *this;
1557 }
1558
1569 SharedString& operator=(const std::string& other) {
1570 *value = other;
1571 return *this;
1572 }
1573
1584 SharedString(SharedString&& other) noexcept : value(std::move(other.value)) {}
1585
1597 if (this != &other) {
1598 value = std::move(other.value);
1599 }
1600 return *this;
1601 }
1602
1612 std::string get() const { return *value; }
1613
1621 void set(std::string val) { *value = val; }
1622
1632 operator std::string() { return this->get(); }
1633
1643 std::string operator*() const { return *value; }
1644
1655 std::string* operator->() { return value.get(); }
1656
1669 const std::string* operator->() const { return value.get(); }
1670
1683 friend std::ostream& operator<<(std::ostream& os, const SharedString& sp) {
1684 os << *sp.value;
1685 return os;
1686 }
1687};
1688
1700 private:
1701 std::shared_ptr<bool> value;
1702
1703 public:
1711
1721
1730 SharedBoolean(const SharedBoolean& other) : value(other.value) {}
1731
1744 if (this != &other) {
1745 value = other.value;
1746 }
1747 return *this;
1748 }
1749
1761 *value = other;
1762 return *this;
1763 }
1764
1776 : value(std::move(other.value)) {}
1777
1789 if (this != &other) {
1790 value = std::move(other.value);
1791 }
1792 return *this;
1793 }
1794
1804 bool get() const { return *value; }
1805
1813 void set(bool val) { *value = val; }
1814
1824 operator bool() { return this->get(); }
1825
1835 bool operator*() const { return *value; }
1836
1847 bool* operator->() { return value.get(); }
1848
1861 const bool* operator->() const { return value.get(); }
1862
1873 bool operator==(const SharedBoolean& other) const {
1874 return *value == *other.value;
1875 }
1876
1887 bool operator!=(const SharedBoolean& other) const {
1888 return *value != *other.value;
1889 }
1890
1901 bool operator<(const SharedBoolean& other) const {
1902 return *value < *other.value;
1903 }
1904
1915 bool operator<=(const SharedBoolean& other) const {
1916 return *value <= *other.value;
1917 }
1918
1929 bool operator>(const SharedBoolean& other) const {
1930 return *value > *other.value;
1931 }
1932
1943 bool operator>=(const SharedBoolean& other) const {
1944 return *value >= *other.value;
1945 }
1946
1956 bool operator==(const bool& other) const { return *value == other; }
1957
1967 bool operator!=(const bool& other) const { return *value != other; }
1968
1979 bool operator<(const bool& other) const { return *value < other; }
1980
1991 bool operator<=(const bool& other) const { return *value <= other; }
1992
2003 bool operator>(const bool& other) const { return *value > other; }
2004
2016 bool operator>=(const bool& other) const { return *value >= other; }
2017
2029 friend std::ostream& operator<<(std::ostream& os, const SharedBoolean& sp) {
2030 os << *sp.value;
2031 return os;
2032 }
2033};
2034
2046bool operator<(const bool& lhs, const SharedBoolean& rhs) {
2047 return (lhs < rhs.get());
2048}
2049
2061bool operator<=(const bool& lhs, const SharedBoolean& rhs) {
2062 return (lhs <= rhs.get());
2063}
2064
2076bool operator>(const bool& lhs, const SharedBoolean& rhs) {
2077 return (lhs > rhs.get());
2078}
2079
2091bool operator>=(const bool& lhs, const SharedBoolean& rhs) {
2092 return (lhs >= rhs.get());
2093}
2094
2127
2128#endif
A class that provides shared ownership of a boolean value.
Definition rcpp_shared_primitive.hpp:1699
SharedBoolean(SharedBoolean &&other) noexcept
Constructs a new SharedBoolean object by moving resources.
Definition rcpp_shared_primitive.hpp:1775
bool operator!=(const bool &other) const
Overloads the inequality operator (!=) for a boolean value.
Definition rcpp_shared_primitive.hpp:1967
SharedBoolean(bool val)
Constructs a new SharedBoolean object from a boolean value.
Definition rcpp_shared_primitive.hpp:1720
bool operator>=(const bool &other) const
Overloads the greater-than-or-equal-to operator (>=) for a boolean.
Definition rcpp_shared_primitive.hpp:2016
bool operator<(const bool &other) const
Overloads the less-than operator (<) for a boolean value.
Definition rcpp_shared_primitive.hpp:1979
bool operator<(const SharedBoolean &other) const
Overloads the less-than operator (<).
Definition rcpp_shared_primitive.hpp:1901
SharedBoolean(const SharedBoolean &other)
Copy constructs a new SharedBoolean object.
Definition rcpp_shared_primitive.hpp:1730
SharedBoolean & operator=(const bool &other)
Overloaded assignment operator for a boolean value.
Definition rcpp_shared_primitive.hpp:1760
const bool * operator->() const
Overloads the member access operator (->) for const objects.
Definition rcpp_shared_primitive.hpp:1861
bool operator>=(const SharedBoolean &other) const
Overloads the greater-than-or-equal-to operator (>=).
Definition rcpp_shared_primitive.hpp:1943
SharedBoolean & operator=(const SharedBoolean &other)
Overloaded copy assignment operator.
Definition rcpp_shared_primitive.hpp:1743
bool operator!=(const SharedBoolean &other) const
Overloads the inequality operator (!=).
Definition rcpp_shared_primitive.hpp:1887
bool operator==(const SharedBoolean &other) const
Overloads the equality operator (==).
Definition rcpp_shared_primitive.hpp:1873
void set(bool val)
Sets the boolean value of the object.
Definition rcpp_shared_primitive.hpp:1813
bool operator>(const SharedBoolean &other) const
Overloads the greater-than operator (>).
Definition rcpp_shared_primitive.hpp:1929
bool operator==(const bool &other) const
Overloads the equality operator (==) for a boolean value.
Definition rcpp_shared_primitive.hpp:1956
bool * operator->()
Overloads the member access operator (->).
Definition rcpp_shared_primitive.hpp:1847
SharedBoolean & operator=(SharedBoolean &&other) noexcept
Overloaded move assignment operator.
Definition rcpp_shared_primitive.hpp:1788
bool operator<=(const bool &other) const
Overloads the less-than-or-equal-to operator (<=) for a boolean.
Definition rcpp_shared_primitive.hpp:1991
bool get() const
Retrieves the boolean value managed by the object.
Definition rcpp_shared_primitive.hpp:1804
friend std::ostream & operator<<(std::ostream &os, const SharedBoolean &sp)
Overloads the stream insertion operator (<<) for SharedBoolean.
Definition rcpp_shared_primitive.hpp:2029
bool operator<=(const SharedBoolean &other) const
Overloads the less-than-or-equal-to operator (<=).
Definition rcpp_shared_primitive.hpp:1915
SharedBoolean()
Constructs a new SharedBoolean object with a default value.
Definition rcpp_shared_primitive.hpp:1710
bool operator>(const bool &other) const
Overloads the greater-than operator (>) for a boolean value.
Definition rcpp_shared_primitive.hpp:2003
bool operator*() const
Overloads the dereference operator (*).
Definition rcpp_shared_primitive.hpp:1835
A class that provides shared ownership of an integer value.
Definition rcpp_shared_primitive.hpp:24
SharedInt operator/(const SharedInt &other) const
Overloads the binary division operator (/).
Definition rcpp_shared_primitive.hpp:296
void set(int val)
Change the value of the integer.
Definition rcpp_shared_primitive.hpp:129
int * operator->()
Overloads the member access operator (->).
Definition rcpp_shared_primitive.hpp:165
SharedInt()
Construct a new SharedInt object.
Definition rcpp_shared_primitive.hpp:33
SharedInt & operator--()
Overloads the prefix decrement operator (--).
Definition rcpp_shared_primitive.hpp:220
bool operator!=(const SharedInt &other) const
Overloads the inequality operator (!=).
Definition rcpp_shared_primitive.hpp:504
SharedInt operator*(const SharedInt &other) const
Overloads the binary multiplication operator (*).
Definition rcpp_shared_primitive.hpp:282
SharedInt & operator++()
Overloads the prefix increment operator (++).
Definition rcpp_shared_primitive.hpp:190
SharedInt & operator*=(const int &other)
Overloads the compound assignment operator (*=) for a shared integer value.
Definition rcpp_shared_primitive.hpp:460
SharedInt & operator*=(const SharedInt &other)
Overloads the compound assignment operator (*=).
Definition rcpp_shared_primitive.hpp:398
bool operator!=(const int &other) const
Overloads the inequality operator (!=) for an integer value.
Definition rcpp_shared_primitive.hpp:582
int operator*() const
Overloads the dereference operator.
Definition rcpp_shared_primitive.hpp:153
SharedInt & operator/=(const int &other)
Overloads the compound assignment operator (/=) for a shared integer value.
Definition rcpp_shared_primitive.hpp:475
SharedInt operator++(int)
Overloads the postfix increment operator (++).
Definition rcpp_shared_primitive.hpp:205
bool operator>(const SharedInt &other) const
Overloads the greater-than operator (>).
Definition rcpp_shared_primitive.hpp:544
const int * operator->() const
Overloads the member access operator (->) for const objects.
Definition rcpp_shared_primitive.hpp:177
SharedInt operator+(const SharedInt &other) const
Overloads the binary addition operator (+).
Definition rcpp_shared_primitive.hpp:253
SharedInt & operator=(SharedInt &&other) noexcept
Overloaded move assignment operator.
Definition rcpp_shared_primitive.hpp:108
SharedInt operator/(const int &other) const
Overloads the binary division operator for an integer value.
Definition rcpp_shared_primitive.hpp:354
SharedInt & operator-=(const SharedInt &other)
Overloads the compound assignment operator (-=).
Definition rcpp_shared_primitive.hpp:383
SharedInt & operator=(const SharedInt &other)
Overloaded assignment operator for copying a SharedInt object.
Definition rcpp_shared_primitive.hpp:65
SharedInt & operator-=(const int &other)
Overloads the compound assignment operator (-=) for a shared integer value.
Definition rcpp_shared_primitive.hpp:444
SharedInt & operator=(const int &other)
Overloaded assignment operator for an integer value.
Definition rcpp_shared_primitive.hpp:81
SharedInt operator*(const int &other) const
Overloads the binary multiplication operator for an integer value.
Definition rcpp_shared_primitive.hpp:340
bool operator>=(const int &other) const
Overloads the greater-than-or-equal-to operator (>=) for an integer value.
Definition rcpp_shared_primitive.hpp:632
SharedInt & operator+=(const SharedInt &other)
Overloads the compound assignment operator (+=).
Definition rcpp_shared_primitive.hpp:369
SharedInt operator--(int)
Overloads the postfix decrement operator.
Definition rcpp_shared_primitive.hpp:235
SharedInt(int val)
Constructs a new SharedInt object.
Definition rcpp_shared_primitive.hpp:43
bool operator==(const SharedInt &other) const
Overloads the equality operator (==).
Definition rcpp_shared_primitive.hpp:491
bool operator<=(const SharedInt &other) const
Overloads the less-than-or-equal-to operator (<=).
Definition rcpp_shared_primitive.hpp:530
SharedInt(SharedInt &&other) noexcept
Constructs a new SharedInt object by moving resources.
Definition rcpp_shared_primitive.hpp:96
SharedInt operator+(const int &other) const
Overloads the binary addition operator for an integer value.
Definition rcpp_shared_primitive.hpp:312
bool operator<=(const int &other) const
Overloads the less-than-or-equal-to operator (<=) for an integer value.
Definition rcpp_shared_primitive.hpp:607
SharedInt operator-(const SharedInt &other) const
Overloads the binary subtraction operator (-).
Definition rcpp_shared_primitive.hpp:268
SharedInt & operator+=(const int &other)
Overloads the compound assignment operator (+=) for a shared integer value.
Definition rcpp_shared_primitive.hpp:429
bool operator>(const int &other) const
Overloads the greater-than operator (>) for an integer value.
Definition rcpp_shared_primitive.hpp:619
bool operator<(const SharedInt &other) const
Overloads the less-than operator (<).
Definition rcpp_shared_primitive.hpp:518
SharedInt operator-(const int &other) const
Overloads the binary subtraction operator for an integer value.
Definition rcpp_shared_primitive.hpp:326
friend std::ostream & operator<<(std::ostream &os, const SharedInt &sp)
Overloads the stream insertion operator (<<) for SharedInt.
Definition rcpp_shared_primitive.hpp:644
bool operator==(const int &other) const
Overloads the equality operator (==) for an integer value.
Definition rcpp_shared_primitive.hpp:571
bool operator>=(const SharedInt &other) const
Overloads the greater-than-or-equal-to operator (>=).
Definition rcpp_shared_primitive.hpp:556
bool operator<(const int &other) const
Overloads the less-than operator (<) for an integer value.
Definition rcpp_shared_primitive.hpp:594
SharedInt(const SharedInt &other)
Copy constructs a new SharedInt object.
Definition rcpp_shared_primitive.hpp:53
int get() const
Retrieve the value of the integer.
Definition rcpp_shared_primitive.hpp:122
SharedInt & operator/=(const SharedInt &other)
Overloads the compound assignment operator (/=).
Definition rcpp_shared_primitive.hpp:412
A class that provides shared ownership of an integer value.
Definition rcpp_shared_primitive.hpp:784
SharedReal & operator=(const int &other)
Overloaded assignment operator for an integer value.
Definition rcpp_shared_primitive.hpp:845
SharedReal operator+(const SharedReal &other) const
Overloads the binary addition operator (+).
Definition rcpp_shared_primitive.hpp:1024
bool operator>=(const SharedReal &other) const
Overloads the greater-than-or-equal-to operator (>=).
Definition rcpp_shared_primitive.hpp:1341
bool operator>=(const int &other) const
Overloads the greater-than-or-equal-to operator (>=) for an integer.
Definition rcpp_shared_primitive.hpp:1417
SharedReal & operator+=(const int &other)
Overloads the compound assignment operator (+=) for an integer.
Definition rcpp_shared_primitive.hpp:1206
void set(int val)
Sets the integer value of the object.
Definition rcpp_shared_primitive.hpp:899
int * operator->()
Overloads the member access operator (->).
Definition rcpp_shared_primitive.hpp:935
SharedReal & operator/=(const int &other)
Overloads the compound assignment operator (/=) for an integer.
Definition rcpp_shared_primitive.hpp:1254
SharedReal & operator*=(const SharedReal &other)
Overloads the compound assignment operator (*=).
Definition rcpp_shared_primitive.hpp:1175
bool operator==(const int &other) const
Overloads the equality operator (==) for an integer value.
Definition rcpp_shared_primitive.hpp:1356
SharedReal & operator*=(const int &other)
Overloads the compound assignment operator (*=) for an integer.
Definition rcpp_shared_primitive.hpp:1238
SharedReal operator*(const int &other) const
Overloads the binary multiplication operator (*) for an integer.
Definition rcpp_shared_primitive.hpp:1115
SharedReal operator-(const SharedReal &other) const
Overloads the binary subtraction operator (-).
Definition rcpp_shared_primitive.hpp:1040
bool operator!=(const SharedReal &other) const
Overloads the inequality operator (!=).
Definition rcpp_shared_primitive.hpp:1285
bool operator<=(const SharedReal &other) const
Overloads the less-than-or-equal-to operator (<=).
Definition rcpp_shared_primitive.hpp:1313
SharedReal operator++(int)
Overloads the postfix increment operator.
Definition rcpp_shared_primitive.hpp:975
SharedReal & operator=(SharedReal &&other) noexcept
Overloaded move assignment operator.
Definition rcpp_shared_primitive.hpp:874
SharedReal & operator-=(const SharedReal &other)
Overloads the compound assignment operator (-=).
Definition rcpp_shared_primitive.hpp:1160
const int * operator->() const
Overloads the member access operator (->) for const objects.
Definition rcpp_shared_primitive.hpp:947
SharedReal & operator+=(const SharedReal &other)
Overloads the compound assignment operator (+=).
Definition rcpp_shared_primitive.hpp:1145
bool operator>(const SharedReal &other) const
Overloads the greater-than operator (>).
Definition rcpp_shared_primitive.hpp:1327
int operator*() const
Overloads the dereference operator (*).
Definition rcpp_shared_primitive.hpp:923
SharedReal operator-(const int &other) const
Overloads the binary subtraction operator (-) for an integer.
Definition rcpp_shared_primitive.hpp:1100
SharedReal & operator--()
Overloads the prefix decrement operator (--).
Definition rcpp_shared_primitive.hpp:991
SharedReal operator/(const SharedReal &other) const
Overloads the binary division operator (/).
Definition rcpp_shared_primitive.hpp:1070
SharedReal()
Constructs a new SharedReal object with a default value.
Definition rcpp_shared_primitive.hpp:795
SharedReal & operator/=(const SharedReal &other)
Overloads the compound assignment operator (/=).
Definition rcpp_shared_primitive.hpp:1190
friend std::ostream & operator<<(std::ostream &os, const SharedReal &sp)
Overloads the stream insertion operator (<<) for SharedReal.
Definition rcpp_shared_primitive.hpp:1429
SharedReal & operator-=(const int &other)
Overloads the compound assignment operator (-=) for an integer.
Definition rcpp_shared_primitive.hpp:1222
SharedReal operator*(const SharedReal &other) const
Overloads the binary multiplication operator (*).
Definition rcpp_shared_primitive.hpp:1055
SharedReal operator/(const int &other) const
Overloads the binary division operator (/) for an integer.
Definition rcpp_shared_primitive.hpp:1129
SharedReal & operator++()
Overloads the prefix increment operator (++).
Definition rcpp_shared_primitive.hpp:960
SharedReal & operator=(const SharedReal &other)
Overloaded copy assignment operator.
Definition rcpp_shared_primitive.hpp:828
bool operator!=(const int &other) const
Overloads the inequality operator (!=) for an integer.
Definition rcpp_shared_primitive.hpp:1367
int get() const
Retrieves the integer value managed by the object.
Definition rcpp_shared_primitive.hpp:890
SharedReal(SharedReal &&other) noexcept
Constructs a new SharedReal object by moving resources.
Definition rcpp_shared_primitive.hpp:861
SharedReal(const SharedReal &other)
Copy constructs a new SharedReal object.
Definition rcpp_shared_primitive.hpp:815
bool operator>(const int &other) const
Overloads the greater-than operator (>) for an integer.
Definition rcpp_shared_primitive.hpp:1404
bool operator<=(const int &other) const
Overloads the less-than-or-equal-to operator (<=) for an integer.
Definition rcpp_shared_primitive.hpp:1392
bool operator<(const int &other) const
Overloads the less-than operator (<) for an integer.
Definition rcpp_shared_primitive.hpp:1379
SharedReal operator--(int)
Overloads the postfix decrement operator.
Definition rcpp_shared_primitive.hpp:1006
bool operator==(const SharedReal &other) const
Overloads the equality operator (==).
Definition rcpp_shared_primitive.hpp:1271
SharedReal(int val)
Constructs a new SharedReal object from an integer value.
Definition rcpp_shared_primitive.hpp:805
SharedReal operator+(const int &other) const
Overloads the binary addition operator (+) for an integer.
Definition rcpp_shared_primitive.hpp:1086
bool operator<(const SharedReal &other) const
Overloads the less-than operator (<).
Definition rcpp_shared_primitive.hpp:1299
A class that provides shared ownership of a string.
Definition rcpp_shared_primitive.hpp:1508
operator std::string()
User-defined conversion to std::string.
Definition rcpp_shared_primitive.hpp:1632
const std::string * operator->() const
Overloads the member access operator (->) for const objects.
Definition rcpp_shared_primitive.hpp:1669
SharedString & operator=(SharedString &&other) noexcept
Overloaded move assignment operator.
Definition rcpp_shared_primitive.hpp:1596
SharedString(SharedString &&other) noexcept
Constructs a new SharedString object by moving resources.
Definition rcpp_shared_primitive.hpp:1584
std::string get() const
Retrieves the string value managed by the object.
Definition rcpp_shared_primitive.hpp:1612
std::string * operator->()
Overloads the member access operator (->).
Definition rcpp_shared_primitive.hpp:1655
SharedString(const SharedString &other)
Copy constructs a new SharedString object.
Definition rcpp_shared_primitive.hpp:1539
SharedString(std::string val)
Constructs a new SharedString object from a string value.
Definition rcpp_shared_primitive.hpp:1529
friend std::ostream & operator<<(std::ostream &os, const SharedString &sp)
Overloads the stream insertion operator (<<) for SharedString.
Definition rcpp_shared_primitive.hpp:1683
SharedString & operator=(const SharedString &other)
Overloaded copy assignment operator.
Definition rcpp_shared_primitive.hpp:1552
void set(std::string val)
Sets the string value of the object.
Definition rcpp_shared_primitive.hpp:1621
SharedString & operator=(const std::string &other)
Overloaded assignment operator for a string value.
Definition rcpp_shared_primitive.hpp:1569
std::string operator*() const
Overloads the dereference operator (*).
Definition rcpp_shared_primitive.hpp:1643
SharedString()
Constructs a new SharedString object with a default, empty value.
Definition rcpp_shared_primitive.hpp:1519
void clear_internal()
Clears the internal objects.
Definition rcpp_interface.hpp:279
SharedInt operator-(const int &lhs, const SharedInt &rhs)
Overloads the binary subtraction operator (-) for an integer left-hand side operand.
Definition rcpp_shared_primitive.hpp:680
SharedReal fims_double
An alias for the SharedReal class.
Definition rcpp_shared_primitive.hpp:2110
SharedBoolean fims_bool
An alias for the SharedBoolean class.
Definition rcpp_shared_primitive.hpp:2126
SharedInt operator+(const int &lhs, const SharedInt &rhs)
Overloads the binary addition operator (+) for an integer left-hand side operand.
Definition rcpp_shared_primitive.hpp:664
bool operator>(const int &lhs, const SharedInt &rhs)
Overloads the greater-than operator (>) for an integer left-hand side operand.
Definition rcpp_shared_primitive.hpp:755
SharedInt fims_int
An alias for the SharedInt class.
Definition rcpp_shared_primitive.hpp:2102
bool operator>=(const int &lhs, const SharedInt &rhs)
Overloads the greater-than-or-equal-to operator (>=) for an integer left-hand side operand.
Definition rcpp_shared_primitive.hpp:770
SharedInt operator/(const int &lhs, const SharedInt &rhs)
Overloads the binary division operator (/) for an integer left-hand side operand.
Definition rcpp_shared_primitive.hpp:710
SharedInt operator*(const int &lhs, const SharedInt &rhs)
Overloads the binary multiplication operator (*) for an integer left-hand side operand.
Definition rcpp_shared_primitive.hpp:695
bool operator<(const int &lhs, const SharedInt &rhs)
Overloads the less-than operator (<) for an integer left-hand side operand.
Definition rcpp_shared_primitive.hpp:725
bool operator<=(const int &lhs, const SharedInt &rhs)
Overloads the less-than-or-equal-to operator (<=) for an integer left-hand side operand.
Definition rcpp_shared_primitive.hpp:740
SharedString fims_string
An alias for the SharedString class.
Definition rcpp_shared_primitive.hpp:2118