3 #include "clave_fija.h"
5 ClaveFija::ClaveFija (int n, uint bd)
11 ClaveFija::ClaveFija (uchar *n)
13 memcpy (&data, n, sizeof(int));
14 memcpy (&block_data, n+sizeof(int), sizeof(int));
17 uint ClaveFija::Size () const
19 return sizeof (int)+sizeof(uint);
22 uchar *ClaveFija::ToArray () const
25 out = new uchar[Size ()];
26 memcpy (out, &data, sizeof(int));
27 memcpy (out+sizeof (int), &block_data, sizeof(int));
31 Clave *ClaveFija::Clone () const
33 ClaveFija *k = new ClaveFija (*this);
37 bool ClaveFija::operator < (const Clave &c) const
39 return data < ((ClaveFija&)c).data;
42 bool ClaveFija::operator == (const Clave &c) const
44 return data == ((ClaveFija&)c).data;
47 uchar *ClaveFija::ToRaw (uint &size) const
58 std::string s = ss.str ();
60 uchar *out = new uchar[s.size ()];
61 memcpy (out, s.c_str (), s.size ());