X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/1b6152a8b901df0e8b57c35b9846a6e609b8b7df..5ade66d0aa29a2fed034a93326a49b2edcd2e7ec:/src/clave_fija.cpp 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; +}