3 #include "clave_fija.h"
5 ClaveFija::ClaveFija (int n)
10 ClaveFija::ClaveFija (uchar *n)
12 memcpy (&data, n, sizeof(int));
13 memcpy (&block_data, n+sizeof(int), sizeof(int));
16 uint ClaveFija::Size () const
18 return sizeof (int)+sizeof(uint);
21 uchar *ClaveFija::ToArray () const
24 out = new uchar[Size ()];
25 memcpy (out, &data, sizeof(int));
26 memcpy (out+sizeof (int), &block_data, sizeof(int));
30 Clave *ClaveFija::Clone () const
32 ClaveFija *k = new ClaveFija (*this);
36 bool ClaveFija::operator < (const Clave &c) const
38 return data < ((ClaveFija&)c).data;
41 bool ClaveFija::operator == (const Clave &c) const
43 return data == ((ClaveFija&)c).data;
46 uchar *ClaveFija::ToRaw (uint &size) const
57 std::string s = ss.str ();
59 uchar *out = new uchar[s.size ()];
60 memcpy (out, s.c_str (), s.size ());