X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/blobdiff_plain/1b6152a8b901df0e8b57c35b9846a6e609b8b7df..4582a22e254c682b0e91750725401d018c9e93f2:/src/clave_fija.cpp?ds=sidebyside diff --git a/src/clave_fija.cpp b/src/clave_fija.cpp index 05c9814..5a547eb 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,14 @@ 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; +} +