FIMS  v0.9.3
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#include <ostream>
14#include <sstream>
15#include <string>
16
17#include <Rcpp.h>
18
29class SharedInt {
30 private:
31 std::shared_ptr<int> value;
32
33 public:
38 SharedInt() : value(std::make_shared<int>(0)) {}
39
48 SharedInt(int val) : value(std::make_shared<int>(val)) {}
49
58 SharedInt(const SharedInt& other) : value(other.value) {}
59
71 if (this != &other) {
72 value = other.value;
73 }
74 return *this;
75 }
76
86 SharedInt& operator=(const int& other) {
87 *value = other;
88
89 return *this;
90 }
91
101 SharedInt(SharedInt&& other) noexcept : value(std::move(other.value)) {}
102
114 if (this != &other) {
115 value = std::move(other.value);
116 }
117 return *this;
118 }
119
120 // Access the value
121
127 int get() const { return *value; }
128
134 void set(int val) { *value = val; }
135
145 operator int() { return this->get(); }
146
147 // Overloaded operators for SharedPrimitive
148
158 int operator*() const { return *value; }
159
170 int* operator->() { return value.get(); }
171
182 const int* operator->() const { return value.get(); }
183
184 // Unary operators
185
196 ++(*value);
197 return *this;
198 }
199
211 SharedInt temp(*this);
212 ++(*value);
213 return temp;
214 }
215
226 --(*value);
227 return *this;
228 }
229
241 SharedInt temp(*this);
242 --(*value);
243 return temp;
244 }
245
246 // Arithmetic operators with SharedPrimitive
247
259 return SharedInt(*value + *other.value);
260 }
261
274 return SharedInt(*value - *other.value);
275 }
276
288 return SharedInt(*value * *other.value);
289 }
290
302 return SharedInt(*value / *other.value);
303 }
304
305 // Arithmetic operators with primitives
306
317 SharedInt operator+(const int& other) const {
318 return SharedInt(*value + other);
319 }
320
331 SharedInt operator-(const int& other) const {
332 return SharedInt(*value - other);
333 }
334
345 SharedInt operator*(const int& other) const {
346 return SharedInt(*value * other);
347 }
348
359 SharedInt operator/(const int& other) const {
360 return SharedInt(*value / other);
361 }
362
363 // Compound assignment operators with SharedPrimitive
364
375 *value += *other.value;
376 return *this;
377 }
378
389 *value -= *other.value;
390 return *this;
391 }
392
404 *value *= *other.value;
405 return *this;
406 }
407
418 *value /= *other.value;
419 return *this;
420 }
421
422 // Compound assignment operators with primitives
423
435 *value += other;
436 return *this;
437 }
438
450 *value -= other;
451 return *this;
452 }
453
466 *value *= other;
467 return *this;
468 }
469
481 *value /= other;
482 return *this;
483 }
484
485 // Relational operators
486
496 bool operator==(const SharedInt& other) const {
497 return *value == *other.value;
498 }
499
509 bool operator!=(const SharedInt& other) const {
510 return *value != *other.value;
511 }
512
523 bool operator<(const SharedInt& other) const { return *value < *other.value; }
524
535 bool operator<=(const SharedInt& other) const {
536 return *value <= *other.value;
537 }
538
549 bool operator>(const SharedInt& other) const { return *value > *other.value; }
550
561 bool operator>=(const SharedInt& other) const {
562 return *value >= *other.value;
563 }
564
565 // Relational operators with primitives
566
576 bool operator==(const int& other) const { return *value == other; }
577
587 bool operator!=(const int& other) const { return *value != other; }
588
599 bool operator<(const int& other) const { return *value < other; }
600
612 bool operator<=(const int& other) const { return *value <= other; }
613
624 bool operator>(const int& other) const { return *value > other; }
625
637 bool operator>=(const int& other) const { return *value >= other; }
638
649 friend std::ostream& operator<<(std::ostream& os, const SharedInt& sp) {
650 os << *sp.value;
651 return os;
652 }
653};
654
655// Non-member operators for primitive + SharedPrimitive
656
669inline SharedInt operator+(const int& lhs, const SharedInt& rhs) {
670 return SharedInt(lhs + rhs.get());
671}
672
685inline SharedInt operator-(const int& lhs, const SharedInt& rhs) {
686 return SharedInt(lhs - rhs.get());
687}
688
700inline SharedInt operator*(const int& lhs, const SharedInt& rhs) {
701 return SharedInt(lhs * rhs.get());
702}
703
715inline SharedInt operator/(const int& lhs, const SharedInt& rhs) {
716 return SharedInt(lhs / rhs.get());
717}
718
730inline bool operator<(const int& lhs, const SharedInt& rhs) {
731 return (lhs < rhs.get());
732}
733
745inline bool operator<=(const int& lhs, const SharedInt& rhs) {
746 return (lhs <= rhs.get());
747}
748
760inline bool operator>(const int& lhs, const SharedInt& rhs) {
761 return (lhs > rhs.get());
762}
763
775inline bool operator>=(const int& lhs, const SharedInt& rhs) {
776 return (lhs >= rhs.get());
777}
778
790 private:
791 std::shared_ptr<int> value;
792
793 public:
800 SharedReal() : value(std::make_shared<int>(0)) {}
801
810 SharedReal(int val) : value(std::make_shared<int>(val)) {}
811
820 SharedReal(const SharedReal& other) : value(other.value) {}
821
834 if (this != &other) {
835 value = other.value;
836 }
837 return *this;
838 }
839
851 *value = other;
852
853 return *this;
854 }
855
866 SharedReal(SharedReal&& other) noexcept : value(std::move(other.value)) {}
867
880 if (this != &other) {
881 value = std::move(other.value);
882 }
883 return *this;
884 }
885
895 int get() const { return *value; }
896
904 void set(int val) { *value = val; }
905
915 operator int() { return this->get(); }
916
917 // Overloaded operators for SharedPrimitive
918
928 int operator*() const { return *value; }
929
940 int* operator->() { return value.get(); }
941
952 const int* operator->() const { return value.get(); }
953
954 // Unary operators
955
966 ++(*value);
967 return *this;
968 }
969
981 SharedReal temp(*this);
982 ++(*value);
983 return temp;
984 }
985
997 --(*value);
998 return *this;
999 }
1000
1012 SharedReal temp(*this);
1013 --(*value);
1014 return temp;
1015 }
1016
1017 // Arithmetic operators with SharedPrimitive
1018
1030 return SharedReal(*value + *other.value);
1031 }
1032
1046 return SharedReal(*value - *other.value);
1047 }
1048
1061 return SharedReal(*value * *other.value);
1062 }
1063
1076 return SharedReal(*value / *other.value);
1077 }
1078
1079 // Arithmetic operators with primitives
1080
1091 SharedReal operator+(const int& other) const {
1092 return SharedReal(*value + other);
1093 }
1094
1105 SharedReal operator-(const int& other) const {
1106 return SharedReal(*value - other);
1107 }
1108
1120 SharedReal operator*(const int& other) const {
1121 return SharedReal(*value * other);
1122 }
1123
1134 SharedReal operator/(const int& other) const {
1135 return SharedReal(*value / other);
1136 }
1137
1138 // Compound assignment operators with SharedPrimitive
1139
1151 *value += *other.value;
1152 return *this;
1153 }
1154
1166 *value -= *other.value;
1167 return *this;
1168 }
1169
1181 *value *= *other.value;
1182 return *this;
1183 }
1184
1196 *value /= *other.value;
1197 return *this;
1198 }
1199
1212 *value += other;
1213 return *this;
1214 }
1215
1228 *value -= other;
1229 return *this;
1230 }
1231
1244 *value *= other;
1245 return *this;
1246 }
1247
1260 *value /= other;
1261 return *this;
1262 }
1263
1264 // Relational operators
1265
1276 bool operator==(const SharedReal& other) const {
1277 return *value == *other.value;
1278 }
1279
1290 bool operator!=(const SharedReal& other) const {
1291 return *value != *other.value;
1292 }
1293
1304 bool operator<(const SharedReal& other) const {
1305 return *value < *other.value;
1306 }
1307
1318 bool operator<=(const SharedReal& other) const {
1319 return *value <= *other.value;
1320 }
1321
1332 bool operator>(const SharedReal& other) const {
1333 return *value > *other.value;
1334 }
1335
1346 bool operator>=(const SharedReal& other) const {
1347 return *value >= *other.value;
1348 }
1349
1350 // Relational operators with primitives
1351
1361 bool operator==(const int& other) const { return *value == other; }
1362
1372 bool operator!=(const int& other) const { return *value != other; }
1373
1384 bool operator<(const int& other) const { return *value < other; }
1385
1397 bool operator<=(const int& other) const { return *value <= other; }
1398
1409 bool operator>(const int& other) const { return *value > other; }
1410
1422 bool operator>=(const int& other) const { return *value >= other; }
1423
1434 friend std::ostream& operator<<(std::ostream& os, const SharedReal& sp) {
1435 os << *sp.value;
1436 return os;
1437 }
1438};
1439
1452inline SharedReal operator+(const double& lhs, const SharedReal& rhs) {
1453 return SharedReal(lhs + rhs.get());
1454}
1455
1469inline SharedReal operator-(const double& lhs, const SharedReal& rhs) {
1470 return SharedReal(lhs - rhs.get());
1471}
1472
1484inline SharedReal operator*(const double& lhs, const SharedReal& rhs) {
1485 return SharedReal(lhs * rhs.get());
1486}
1487
1499inline SharedReal operator/(const double& lhs, const SharedReal& rhs) {
1500 return SharedReal(lhs / rhs.get());
1501}
1502
1514 private:
1515 std::shared_ptr<std::string> value;
1516
1517 public:
1525
1534 SharedString(std::string val) : value(std::make_shared<std::string>(val)) {}
1535
1544 SharedString(const SharedString& other) : value(other.value) {}
1545
1558 if (this != &other) {
1559 value = other.value;
1560 }
1561 return *this;
1562 }
1563
1574 SharedString& operator=(const std::string& other) {
1575 *value = other;
1576 return *this;
1577 }
1578
1589 SharedString(SharedString&& other) noexcept : value(std::move(other.value)) {}
1590
1602 if (this != &other) {
1603 value = std::move(other.value);
1604 }
1605 return *this;
1606 }
1607
1617 std::string get() const { return *value; }
1618
1626 void set(std::string val) { *value = val; }
1627
1637 operator std::string() { return this->get(); }
1638
1648 std::string operator*() const { return *value; }
1649
1660 std::string* operator->() { return value.get(); }
1661
1674 const std::string* operator->() const { return value.get(); }
1675
1688 friend std::ostream& operator<<(std::ostream& os, const SharedString& sp) {
1689 os << *sp.value;
1690 return os;
1691 }
1692};
1693
1705 private:
1706 std::shared_ptr<bool> value;
1707
1708 public:
1716
1726
1735 SharedBoolean(const SharedBoolean& other) : value(other.value) {}
1736
1749 if (this != &other) {
1750 value = other.value;
1751 }
1752 return *this;
1753 }
1754
1766 *value = other;
1767 return *this;
1768 }
1769
1781 : value(std::move(other.value)) {}
1782
1794 if (this != &other) {
1795 value = std::move(other.value);
1796 }
1797 return *this;
1798 }
1799
1809 bool get() const { return *value; }
1810
1818 void set(bool val) { *value = val; }
1819
1829 operator bool() { return this->get(); }
1830
1840 bool operator*() const { return *value; }
1841
1852 bool* operator->() { return value.get(); }
1853
1866 const bool* operator->() const { return value.get(); }
1867
1878 bool operator==(const SharedBoolean& other) const {
1879 return *value == *other.value;
1880 }
1881
1892 bool operator!=(const SharedBoolean& other) const {
1893 return *value != *other.value;
1894 }
1895
1906 bool operator<(const SharedBoolean& other) const {
1907 return *value < *other.value;
1908 }
1909
1920 bool operator<=(const SharedBoolean& other) const {
1921 return *value <= *other.value;
1922 }
1923
1934 bool operator>(const SharedBoolean& other) const {
1935 return *value > *other.value;
1936 }
1937
1948 bool operator>=(const SharedBoolean& other) const {
1949 return *value >= *other.value;
1950 }
1951
1961 bool operator==(const bool& other) const { return *value == other; }
1962
1972 bool operator!=(const bool& other) const { return *value != other; }
1973
1984 bool operator<(const bool& other) const { return *value < other; }
1985
1996 bool operator<=(const bool& other) const { return *value <= other; }
1997
2008 bool operator>(const bool& other) const { return *value > other; }
2009
2021 bool operator>=(const bool& other) const { return *value >= other; }
2022
2034 friend std::ostream& operator<<(std::ostream& os, const SharedBoolean& sp) {
2035 os << *sp.value;
2036 return os;
2037 }
2038};
2039
2051inline bool operator<(const bool& lhs, const SharedBoolean& rhs) {
2052 return (lhs < rhs.get());
2053}
2054
2066inline bool operator<=(const bool& lhs, const SharedBoolean& rhs) {
2067 return (lhs <= rhs.get());
2068}
2069
2081inline bool operator>(const bool& lhs, const SharedBoolean& rhs) {
2082 return (lhs > rhs.get());
2083}
2084
2096inline bool operator>=(const bool& lhs, const SharedBoolean& rhs) {
2097 return (lhs >= rhs.get());
2098}
2099
2132
2137
2138#endif
A class that provides shared ownership of a boolean value.
Definition rcpp_shared_primitive.hpp:1704
SharedBoolean(SharedBoolean &&other) noexcept
Constructs a new SharedBoolean object by moving resources.
Definition rcpp_shared_primitive.hpp:1780
bool operator!=(const bool &other) const
Overloads the inequality operator (!=) for a boolean value.
Definition rcpp_shared_primitive.hpp:1972
SharedBoolean(bool val)
Constructs a new SharedBoolean object from a boolean value.
Definition rcpp_shared_primitive.hpp:1725
bool operator>=(const bool &other) const
Overloads the greater-than-or-equal-to operator (>=) for a boolean.
Definition rcpp_shared_primitive.hpp:2021
bool operator<(const bool &other) const
Overloads the less-than operator (<) for a boolean value.
Definition rcpp_shared_primitive.hpp:1984
bool operator<(const SharedBoolean &other) const
Overloads the less-than operator (<).
Definition rcpp_shared_primitive.hpp:1906
SharedBoolean(const SharedBoolean &other)
Copy constructs a new SharedBoolean object.
Definition rcpp_shared_primitive.hpp:1735
SharedBoolean & operator=(const bool &other)
Overloaded assignment operator for a boolean value.
Definition rcpp_shared_primitive.hpp:1765
const bool * operator->() const
Overloads the member access operator (->) for const objects.
Definition rcpp_shared_primitive.hpp:1866
bool operator>=(const SharedBoolean &other) const
Overloads the greater-than-or-equal-to operator (>=).
Definition rcpp_shared_primitive.hpp:1948
SharedBoolean & operator=(const SharedBoolean &other)
Overloaded copy assignment operator.
Definition rcpp_shared_primitive.hpp:1748
bool operator!=(const SharedBoolean &other) const
Overloads the inequality operator (!=).
Definition rcpp_shared_primitive.hpp:1892
bool operator==(const SharedBoolean &other) const
Overloads the equality operator (==).
Definition rcpp_shared_primitive.hpp:1878
void set(bool val)
Sets the boolean value of the object.
Definition rcpp_shared_primitive.hpp:1818
bool operator>(const SharedBoolean &other) const
Overloads the greater-than operator (>).
Definition rcpp_shared_primitive.hpp:1934
bool operator==(const bool &other) const
Overloads the equality operator (==) for a boolean value.
Definition rcpp_shared_primitive.hpp:1961
bool * operator->()
Overloads the member access operator (->).
Definition rcpp_shared_primitive.hpp:1852
SharedBoolean & operator=(SharedBoolean &&other) noexcept
Overloaded move assignment operator.
Definition rcpp_shared_primitive.hpp:1793
bool operator<=(const bool &other) const
Overloads the less-than-or-equal-to operator (<=) for a boolean.
Definition rcpp_shared_primitive.hpp:1996
bool get() const
Retrieves the boolean value managed by the object.
Definition rcpp_shared_primitive.hpp:1809
friend std::ostream & operator<<(std::ostream &os, const SharedBoolean &sp)
Overloads the stream insertion operator (<<) for SharedBoolean.
Definition rcpp_shared_primitive.hpp:2034
bool operator<=(const SharedBoolean &other) const
Overloads the less-than-or-equal-to operator (<=).
Definition rcpp_shared_primitive.hpp:1920
SharedBoolean()
Constructs a new SharedBoolean object with a default value.
Definition rcpp_shared_primitive.hpp:1715
bool operator>(const bool &other) const
Overloads the greater-than operator (>) for a boolean value.
Definition rcpp_shared_primitive.hpp:2008
bool operator*() const
Overloads the dereference operator (*).
Definition rcpp_shared_primitive.hpp:1840
A class that provides shared ownership of an integer value.
Definition rcpp_shared_primitive.hpp:29
SharedInt operator/(const SharedInt &other) const
Overloads the binary division operator (/).
Definition rcpp_shared_primitive.hpp:301
void set(int val)
Change the value of the integer.
Definition rcpp_shared_primitive.hpp:134
int * operator->()
Overloads the member access operator (->).
Definition rcpp_shared_primitive.hpp:170
SharedInt()
Construct a new SharedInt object.
Definition rcpp_shared_primitive.hpp:38
SharedInt & operator--()
Overloads the prefix decrement operator (--).
Definition rcpp_shared_primitive.hpp:225
bool operator!=(const SharedInt &other) const
Overloads the inequality operator (!=).
Definition rcpp_shared_primitive.hpp:509
SharedInt operator*(const SharedInt &other) const
Overloads the binary multiplication operator (*).
Definition rcpp_shared_primitive.hpp:287
SharedInt & operator++()
Overloads the prefix increment operator (++).
Definition rcpp_shared_primitive.hpp:195
SharedInt & operator*=(const int &other)
Overloads the compound assignment operator (*=) for a shared integer value.
Definition rcpp_shared_primitive.hpp:465
SharedInt & operator*=(const SharedInt &other)
Overloads the compound assignment operator (*=).
Definition rcpp_shared_primitive.hpp:403
bool operator!=(const int &other) const
Overloads the inequality operator (!=) for an integer value.
Definition rcpp_shared_primitive.hpp:587
int operator*() const
Overloads the dereference operator.
Definition rcpp_shared_primitive.hpp:158
SharedInt & operator/=(const int &other)
Overloads the compound assignment operator (/=) for a shared integer value.
Definition rcpp_shared_primitive.hpp:480
SharedInt operator++(int)
Overloads the postfix increment operator (++).
Definition rcpp_shared_primitive.hpp:210
bool operator>(const SharedInt &other) const
Overloads the greater-than operator (>).
Definition rcpp_shared_primitive.hpp:549
const int * operator->() const
Overloads the member access operator (->) for const objects.
Definition rcpp_shared_primitive.hpp:182
SharedInt operator+(const SharedInt &other) const
Overloads the binary addition operator (+).
Definition rcpp_shared_primitive.hpp:258
SharedInt & operator=(SharedInt &&other) noexcept
Overloaded move assignment operator.
Definition rcpp_shared_primitive.hpp:113
SharedInt operator/(const int &other) const
Overloads the binary division operator for an integer value.
Definition rcpp_shared_primitive.hpp:359
SharedInt & operator-=(const SharedInt &other)
Overloads the compound assignment operator (-=).
Definition rcpp_shared_primitive.hpp:388
SharedInt & operator=(const SharedInt &other)
Overloaded assignment operator for copying a SharedInt object.
Definition rcpp_shared_primitive.hpp:70
SharedInt & operator-=(const int &other)
Overloads the compound assignment operator (-=) for a shared integer value.
Definition rcpp_shared_primitive.hpp:449
SharedInt & operator=(const int &other)
Overloaded assignment operator for an integer value.
Definition rcpp_shared_primitive.hpp:86
SharedInt operator*(const int &other) const
Overloads the binary multiplication operator for an integer value.
Definition rcpp_shared_primitive.hpp:345
bool operator>=(const int &other) const
Overloads the greater-than-or-equal-to operator (>=) for an integer value.
Definition rcpp_shared_primitive.hpp:637
SharedInt & operator+=(const SharedInt &other)
Overloads the compound assignment operator (+=).
Definition rcpp_shared_primitive.hpp:374
SharedInt operator--(int)
Overloads the postfix decrement operator.
Definition rcpp_shared_primitive.hpp:240
SharedInt(int val)
Constructs a new SharedInt object.
Definition rcpp_shared_primitive.hpp:48
bool operator==(const SharedInt &other) const
Overloads the equality operator (==).
Definition rcpp_shared_primitive.hpp:496
bool operator<=(const SharedInt &other) const
Overloads the less-than-or-equal-to operator (<=).
Definition rcpp_shared_primitive.hpp:535
SharedInt(SharedInt &&other) noexcept
Constructs a new SharedInt object by moving resources.
Definition rcpp_shared_primitive.hpp:101
SharedInt operator+(const int &other) const
Overloads the binary addition operator for an integer value.
Definition rcpp_shared_primitive.hpp:317
bool operator<=(const int &other) const
Overloads the less-than-or-equal-to operator (<=) for an integer value.
Definition rcpp_shared_primitive.hpp:612
SharedInt operator-(const SharedInt &other) const
Overloads the binary subtraction operator (-).
Definition rcpp_shared_primitive.hpp:273
SharedInt & operator+=(const int &other)
Overloads the compound assignment operator (+=) for a shared integer value.
Definition rcpp_shared_primitive.hpp:434
bool operator>(const int &other) const
Overloads the greater-than operator (>) for an integer value.
Definition rcpp_shared_primitive.hpp:624
bool operator<(const SharedInt &other) const
Overloads the less-than operator (<).
Definition rcpp_shared_primitive.hpp:523
SharedInt operator-(const int &other) const
Overloads the binary subtraction operator for an integer value.
Definition rcpp_shared_primitive.hpp:331
friend std::ostream & operator<<(std::ostream &os, const SharedInt &sp)
Overloads the stream insertion operator (<<) for SharedInt.
Definition rcpp_shared_primitive.hpp:649
bool operator==(const int &other) const
Overloads the equality operator (==) for an integer value.
Definition rcpp_shared_primitive.hpp:576
bool operator>=(const SharedInt &other) const
Overloads the greater-than-or-equal-to operator (>=).
Definition rcpp_shared_primitive.hpp:561
bool operator<(const int &other) const
Overloads the less-than operator (<) for an integer value.
Definition rcpp_shared_primitive.hpp:599
SharedInt(const SharedInt &other)
Copy constructs a new SharedInt object.
Definition rcpp_shared_primitive.hpp:58
int get() const
Retrieve the value of the integer.
Definition rcpp_shared_primitive.hpp:127
SharedInt & operator/=(const SharedInt &other)
Overloads the compound assignment operator (/=).
Definition rcpp_shared_primitive.hpp:417
A class that provides shared ownership of an integer value.
Definition rcpp_shared_primitive.hpp:789
SharedReal & operator=(const int &other)
Overloaded assignment operator for an integer value.
Definition rcpp_shared_primitive.hpp:850
SharedReal operator+(const SharedReal &other) const
Overloads the binary addition operator (+).
Definition rcpp_shared_primitive.hpp:1029
bool operator>=(const SharedReal &other) const
Overloads the greater-than-or-equal-to operator (>=).
Definition rcpp_shared_primitive.hpp:1346
bool operator>=(const int &other) const
Overloads the greater-than-or-equal-to operator (>=) for an integer.
Definition rcpp_shared_primitive.hpp:1422
SharedReal & operator+=(const int &other)
Overloads the compound assignment operator (+=) for an integer.
Definition rcpp_shared_primitive.hpp:1211
void set(int val)
Sets the integer value of the object.
Definition rcpp_shared_primitive.hpp:904
int * operator->()
Overloads the member access operator (->).
Definition rcpp_shared_primitive.hpp:940
SharedReal & operator/=(const int &other)
Overloads the compound assignment operator (/=) for an integer.
Definition rcpp_shared_primitive.hpp:1259
SharedReal & operator*=(const SharedReal &other)
Overloads the compound assignment operator (*=).
Definition rcpp_shared_primitive.hpp:1180
bool operator==(const int &other) const
Overloads the equality operator (==) for an integer value.
Definition rcpp_shared_primitive.hpp:1361
SharedReal & operator*=(const int &other)
Overloads the compound assignment operator (*=) for an integer.
Definition rcpp_shared_primitive.hpp:1243
SharedReal operator*(const int &other) const
Overloads the binary multiplication operator (*) for an integer.
Definition rcpp_shared_primitive.hpp:1120
SharedReal operator-(const SharedReal &other) const
Overloads the binary subtraction operator (-).
Definition rcpp_shared_primitive.hpp:1045
bool operator!=(const SharedReal &other) const
Overloads the inequality operator (!=).
Definition rcpp_shared_primitive.hpp:1290
bool operator<=(const SharedReal &other) const
Overloads the less-than-or-equal-to operator (<=).
Definition rcpp_shared_primitive.hpp:1318
SharedReal operator++(int)
Overloads the postfix increment operator.
Definition rcpp_shared_primitive.hpp:980
SharedReal & operator=(SharedReal &&other) noexcept
Overloaded move assignment operator.
Definition rcpp_shared_primitive.hpp:879
SharedReal & operator-=(const SharedReal &other)
Overloads the compound assignment operator (-=).
Definition rcpp_shared_primitive.hpp:1165
const int * operator->() const
Overloads the member access operator (->) for const objects.
Definition rcpp_shared_primitive.hpp:952
SharedReal & operator+=(const SharedReal &other)
Overloads the compound assignment operator (+=).
Definition rcpp_shared_primitive.hpp:1150
bool operator>(const SharedReal &other) const
Overloads the greater-than operator (>).
Definition rcpp_shared_primitive.hpp:1332
int operator*() const
Overloads the dereference operator (*).
Definition rcpp_shared_primitive.hpp:928
SharedReal operator-(const int &other) const
Overloads the binary subtraction operator (-) for an integer.
Definition rcpp_shared_primitive.hpp:1105
SharedReal & operator--()
Overloads the prefix decrement operator (--).
Definition rcpp_shared_primitive.hpp:996
SharedReal operator/(const SharedReal &other) const
Overloads the binary division operator (/).
Definition rcpp_shared_primitive.hpp:1075
SharedReal()
Constructs a new SharedReal object with a default value.
Definition rcpp_shared_primitive.hpp:800
SharedReal & operator/=(const SharedReal &other)
Overloads the compound assignment operator (/=).
Definition rcpp_shared_primitive.hpp:1195
friend std::ostream & operator<<(std::ostream &os, const SharedReal &sp)
Overloads the stream insertion operator (<<) for SharedReal.
Definition rcpp_shared_primitive.hpp:1434
SharedReal & operator-=(const int &other)
Overloads the compound assignment operator (-=) for an integer.
Definition rcpp_shared_primitive.hpp:1227
SharedReal operator*(const SharedReal &other) const
Overloads the binary multiplication operator (*).
Definition rcpp_shared_primitive.hpp:1060
SharedReal operator/(const int &other) const
Overloads the binary division operator (/) for an integer.
Definition rcpp_shared_primitive.hpp:1134
SharedReal & operator++()
Overloads the prefix increment operator (++).
Definition rcpp_shared_primitive.hpp:965
SharedReal & operator=(const SharedReal &other)
Overloaded copy assignment operator.
Definition rcpp_shared_primitive.hpp:833
bool operator!=(const int &other) const
Overloads the inequality operator (!=) for an integer.
Definition rcpp_shared_primitive.hpp:1372
int get() const
Retrieves the integer value managed by the object.
Definition rcpp_shared_primitive.hpp:895
SharedReal(SharedReal &&other) noexcept
Constructs a new SharedReal object by moving resources.
Definition rcpp_shared_primitive.hpp:866
SharedReal(const SharedReal &other)
Copy constructs a new SharedReal object.
Definition rcpp_shared_primitive.hpp:820
bool operator>(const int &other) const
Overloads the greater-than operator (>) for an integer.
Definition rcpp_shared_primitive.hpp:1409
bool operator<=(const int &other) const
Overloads the less-than-or-equal-to operator (<=) for an integer.
Definition rcpp_shared_primitive.hpp:1397
bool operator<(const int &other) const
Overloads the less-than operator (<) for an integer.
Definition rcpp_shared_primitive.hpp:1384
SharedReal operator--(int)
Overloads the postfix decrement operator.
Definition rcpp_shared_primitive.hpp:1011
bool operator==(const SharedReal &other) const
Overloads the equality operator (==).
Definition rcpp_shared_primitive.hpp:1276
SharedReal(int val)
Constructs a new SharedReal object from an integer value.
Definition rcpp_shared_primitive.hpp:810
SharedReal operator+(const int &other) const
Overloads the binary addition operator (+) for an integer.
Definition rcpp_shared_primitive.hpp:1091
bool operator<(const SharedReal &other) const
Overloads the less-than operator (<).
Definition rcpp_shared_primitive.hpp:1304
A class that provides shared ownership of a string.
Definition rcpp_shared_primitive.hpp:1513
operator std::string()
User-defined conversion to std::string.
Definition rcpp_shared_primitive.hpp:1637
const std::string * operator->() const
Overloads the member access operator (->) for const objects.
Definition rcpp_shared_primitive.hpp:1674
SharedString & operator=(SharedString &&other) noexcept
Overloaded move assignment operator.
Definition rcpp_shared_primitive.hpp:1601
SharedString(SharedString &&other) noexcept
Constructs a new SharedString object by moving resources.
Definition rcpp_shared_primitive.hpp:1589
std::string get() const
Retrieves the string value managed by the object.
Definition rcpp_shared_primitive.hpp:1617
std::string * operator->()
Overloads the member access operator (->).
Definition rcpp_shared_primitive.hpp:1660
SharedString(const SharedString &other)
Copy constructs a new SharedString object.
Definition rcpp_shared_primitive.hpp:1544
SharedString(std::string val)
Constructs a new SharedString object from a string value.
Definition rcpp_shared_primitive.hpp:1534
friend std::ostream & operator<<(std::ostream &os, const SharedString &sp)
Overloads the stream insertion operator (<<) for SharedString.
Definition rcpp_shared_primitive.hpp:1688
SharedString & operator=(const SharedString &other)
Overloaded copy assignment operator.
Definition rcpp_shared_primitive.hpp:1557
void set(std::string val)
Sets the string value of the object.
Definition rcpp_shared_primitive.hpp:1626
SharedString & operator=(const std::string &other)
Overloaded assignment operator for a string value.
Definition rcpp_shared_primitive.hpp:1574
std::string operator*() const
Overloads the dereference operator (*).
Definition rcpp_shared_primitive.hpp:1648
SharedString()
Constructs a new SharedString object with a default, empty value.
Definition rcpp_shared_primitive.hpp:1524
void clear_internal()
Clears the internal objects.
Definition rcpp_interface.hpp:235
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:685
SharedReal fims_double
An alias for the SharedReal class.
Definition rcpp_shared_primitive.hpp:2115
SharedBoolean fims_bool
An alias for the SharedBoolean class.
Definition rcpp_shared_primitive.hpp:2131
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:669
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:760
SharedInt fims_int
An alias for the SharedInt class.
Definition rcpp_shared_primitive.hpp:2107
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:775
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:715
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:700
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:730
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:745
SharedString fims_string
An alias for the SharedString class.
Definition rcpp_shared_primitive.hpp:2123