]> www.ginac.de Git - ginac.git/blobdiff - ginac/coloridx.cpp
- renamed archive::dump() to archive::printraw() for consistency with the
[ginac.git] / ginac / coloridx.cpp
index 60e4596815de4a7544645c8a811816510975514a..e7c35c551afc8508a318b64f6ce6b0f25bdab567 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdexcept>
 
 #include "coloridx.h"
+#include "archive.h"
 #include "utils.h"
 #include "debugmsg.h"
 
@@ -30,6 +31,8 @@
 namespace GiNaC {
 #endif // ndef NO_GINAC_NAMESPACE
 
+GINAC_IMPLEMENT_REGISTERED_CLASS(coloridx, idx)
+
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 //////////
@@ -70,12 +73,12 @@ const coloridx & coloridx::operator=(const coloridx & other)
 
 void coloridx::copy(const coloridx & other)
 {
-    idx::copy(other);
+    inherited::copy(other);
 }
 
 void coloridx::destroy(bool call_parent)
 {
-    if (call_parent) idx::destroy(call_parent);
+    if (call_parent) inherited::destroy(call_parent);
 }
 
 //////////
@@ -110,6 +113,28 @@ coloridx::coloridx(unsigned v, bool cov) : idx(v,cov)
     tinfo_key=TINFO_coloridx;
 }
 
+//////////
+// archiving
+//////////
+
+/** Construct object from archive_node. */
+coloridx::coloridx(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+{
+    debugmsg("coloridx constructor from archive_node", LOGLEVEL_CONSTRUCT);
+}
+
+/** Unarchive the object. */
+ex coloridx::unarchive(const archive_node &n, const lst &sym_lst)
+{
+    return (new coloridx(n, sym_lst))->setflag(status_flags::dynallocated);
+}
+
+/** Archive the object. */
+void coloridx::archive(archive_node &n) const
+{
+    inherited::archive(n);
+}
+
 //////////
 // functions overriding virtual functions from bases classes
 //////////