X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/1b6152a8b901df0e8b57c35b9846a6e609b8b7df..51e189bec1aca0e9b263911a81625785a4c50869:/src/clave_fija.cpp?ds=inline diff --git a/src/clave_fija.cpp b/src/clave_fija.cpp index 05c9814..155e0e6 100644 --- a/src/clave_fija.cpp +++ b/src/clave_fija.cpp @@ -2,12 +2,22 @@ #include #include "clave_fija.h" -uint ClaveFija::Size () +ClaveFija::ClaveFija (int n) +{ + data = n; +} + +ClaveFija::ClaveFija (uchar *n) +{ + memcpy (&data, n, sizeof(int)); +} + +uint ClaveFija::Size () const { return sizeof (int); } -uchar *ClaveFija::ToArray () +uchar *ClaveFija::ToArray () const { uchar *out; out = new uchar[sizeof(int)]; @@ -15,3 +25,18 @@ uchar *ClaveFija::ToArray () return out; } +Clave *ClaveFija::Clone () const +{ + ClaveFija *k = new ClaveFija (*this); + return k; +} + +bool ClaveFija::operator < (const Clave &c) const +{ + return data < ((ClaveFija&)c).data; +} + +bool ClaveFija::operator == (const Clave &c) const +{ + return data == ((ClaveFija&)c).data; +}