J
jacob navia
Le 04/08/12 21:17, Ike Naar a écrit :
Yes, but that would break the complete separation between the
implementation and the specifications. As it is now, a complete change
in the inner structure of the containers doesn't need even a
recompilation in user code since all the data types are completely
hidden. This is a very strong requirement of the libray and I have done
everything to ensure that all containers data types are compeletly
opaque to user code.
This is much stronger "private" definition than in C++ where you have
the possibility of accessing the inner structure of the container
because they are specified in the stl headers. Here you do not have
any information about the internals.
I will provide with the library a small program that prints all those
sizes building a header file:
#include <containers.h>
int main (void)
{
printf("#define CCL_iList_SIZE\t%d\n",iList.Sizeof(NULL));
printf("#define CCL_iDictionary_SIZE\t%d\n",
iDictionary.Sizeof(NULL));
printf("#define CCL_iVector_SIZE\t%d\n",iVector.Sizeof(NULL));
// ...
}
This file is stable between releases of the library but must be rebuilt
at each release and client code that uses it must be rebuilt.
If the type of the header structure were known to the program,
there would be a simpler solution:
Yes, but that would break the complete separation between the
implementation and the specifications. As it is now, a complete change
in the inner structure of the containers doesn't need even a
recompilation in user code since all the data types are completely
hidden. This is a very strong requirement of the libray and I have done
everything to ensure that all containers data types are compeletly
opaque to user code.
This is much stronger "private" definition than in C++ where you have
the possibility of accessing the inner structure of the container
because they are specified in the stl headers. Here you do not have
any information about the internals.
I will provide with the library a small program that prints all those
sizes building a header file:
#include <containers.h>
int main (void)
{
printf("#define CCL_iList_SIZE\t%d\n",iList.Sizeof(NULL));
printf("#define CCL_iDictionary_SIZE\t%d\n",
iDictionary.Sizeof(NULL));
printf("#define CCL_iVector_SIZE\t%d\n",iVector.Sizeof(NULL));
// ...
}
This file is stable between releases of the library but must be rebuilt
at each release and client code that uses it must be rebuilt.