![](/media/cache/profiles/94aef38441efa3380a3bed3faf1f9d5d.50x50_q85.jpg)
Diff: RTno/SequenceDataType.cpp
- Revision:
- 0:3c49891bc39d
- Child:
- 1:7f0fc0d1f777
diff -r 000000000000 -r 3c49891bc39d RTno/SequenceDataType.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RTno/SequenceDataType.cpp Fri Jul 29 11:23:44 2011 +0000 @@ -0,0 +1,49 @@ +/******************************************* + * SequenceDataType.h + * @author Yuki Suga + * @copyright Yuki Suga (ysuga.net) Nov, 10th, 2010. + * @license LGPLv3 + *****************************************/ + +#include <stdlib.h> +#include "SequenceDataType.h" +#include "mbed.h" + +Serial pc3(p9,p10); + +SequenceDataType::SequenceDataType(void** ptrptr) +{ + m_ptrptr = ptrptr;*m_ptrptr = 0;len = 0; +} + +SequenceDataType::~SequenceDataType() +{ + free(*m_ptrptr); +} + + +void SequenceDataType::length(int size) +{ + len = size; + pc3.printf("len222\n\r"); + free(*m_ptrptr); + pc3.printf("len333\n\r"); + *m_ptrptr = (void*)malloc(size * SizeofData()); + //*m_ptrptr = (void*)malloc(size * 4); +} + +#if 0 +int SequenceDataType::SizeofData() { + switch(m_TypeCode) { + case 'b': + case 'B': + case 'o': + case 'O': + case 'c': + case 'C': + return 1; + default: + return 4; + } +} +#endif