mirror of
https://github.com/zeldaret/ss
synced 2026-09-04 02:09:59 -04:00
Fix mAng3_c copy assignment, clean up list node templates
This commit is contained in:
+23
-2
@@ -28,10 +28,31 @@ public:
|
||||
fBase_c *p_owner;
|
||||
};
|
||||
|
||||
class fLiNdBaAutoUnlink_c : public fLiNdBa_c {
|
||||
// TODO unofficial, move these to a more appropriate place
|
||||
class fLiNdBaAutoUnlink_c : public fLiNdBa_c {
|
||||
public:
|
||||
fLiNdBaAutoUnlink_c(fBase_c *owner) : fLiNdBa_c(owner) {}
|
||||
~fLiNdBaAutoUnlink_c() { unlink(); }
|
||||
~fLiNdBaAutoUnlink_c() {
|
||||
unlink();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class dAcRef_c : fLiNdBaAutoUnlink_c {
|
||||
public:
|
||||
dAcRef_c(T *owner) : fLiNdBaAutoUnlink_c(owner) {}
|
||||
dAcRef_c() : fLiNdBaAutoUnlink_c(nullptr) {}
|
||||
~dAcRef_c() {}
|
||||
|
||||
void link(T *ref) {
|
||||
p_owner = ref;
|
||||
}
|
||||
void unlink() {
|
||||
fLiNdBa_c::unlink();
|
||||
}
|
||||
T *get() {
|
||||
return static_cast<T *>(p_owner);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user