![](/media/cache/profiles/94aef38441efa3380a3bed3faf1f9d5d.50x50_q85.jpg)
RTno/SequenceDataType.cpp@1:b96a6ff9bb6f, 2011-08-01 (annotated)
- Committer:
- nucho
- Date:
- Mon Aug 01 14:45:58 2011 +0000
- Revision:
- 1:b96a6ff9bb6f
- Parent:
- 0:b14546a3cfab
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nucho | 0:b14546a3cfab | 1 | /******************************************* |
nucho | 0:b14546a3cfab | 2 | * SequenceDataType.h |
nucho | 0:b14546a3cfab | 3 | * @author Yuki Suga |
nucho | 0:b14546a3cfab | 4 | * @copyright Yuki Suga (ysuga.net) Nov, 10th, 2010. |
nucho | 0:b14546a3cfab | 5 | * @license LGPLv3 |
nucho | 0:b14546a3cfab | 6 | *****************************************/ |
nucho | 0:b14546a3cfab | 7 | |
nucho | 0:b14546a3cfab | 8 | #include <stdlib.h> |
nucho | 0:b14546a3cfab | 9 | #include "SequenceDataType.h" |
nucho | 0:b14546a3cfab | 10 | |
nucho | 0:b14546a3cfab | 11 | |
nucho | 0:b14546a3cfab | 12 | SequenceDataType::SequenceDataType(void** ptrptr) |
nucho | 0:b14546a3cfab | 13 | { |
nucho | 0:b14546a3cfab | 14 | m_ptrptr = ptrptr;*m_ptrptr = 0;len = 0; |
nucho | 0:b14546a3cfab | 15 | } |
nucho | 0:b14546a3cfab | 16 | |
nucho | 0:b14546a3cfab | 17 | SequenceDataType::~SequenceDataType() |
nucho | 0:b14546a3cfab | 18 | { |
nucho | 0:b14546a3cfab | 19 | free(*m_ptrptr); |
nucho | 0:b14546a3cfab | 20 | } |
nucho | 0:b14546a3cfab | 21 | |
nucho | 0:b14546a3cfab | 22 | |
nucho | 0:b14546a3cfab | 23 | void SequenceDataType::length(int size) |
nucho | 0:b14546a3cfab | 24 | { |
nucho | 0:b14546a3cfab | 25 | len = size; |
nucho | 0:b14546a3cfab | 26 | free(*m_ptrptr); |
nucho | 0:b14546a3cfab | 27 | *m_ptrptr = (void*)malloc(size * SizeofData()); |
nucho | 0:b14546a3cfab | 28 | //*m_ptrptr = (void*)malloc(size * 4); |
nucho | 0:b14546a3cfab | 29 | } |
nucho | 0:b14546a3cfab | 30 | |
nucho | 0:b14546a3cfab | 31 | #if 0 |
nucho | 0:b14546a3cfab | 32 | int SequenceDataType::SizeofData() { |
nucho | 0:b14546a3cfab | 33 | switch(m_TypeCode) { |
nucho | 0:b14546a3cfab | 34 | case 'b': |
nucho | 0:b14546a3cfab | 35 | case 'B': |
nucho | 0:b14546a3cfab | 36 | case 'o': |
nucho | 0:b14546a3cfab | 37 | case 'O': |
nucho | 0:b14546a3cfab | 38 | case 'c': |
nucho | 0:b14546a3cfab | 39 | case 'C': |
nucho | 0:b14546a3cfab | 40 | return 1; |
nucho | 0:b14546a3cfab | 41 | default: |
nucho | 0:b14546a3cfab | 42 | return 4; |
nucho | 0:b14546a3cfab | 43 | } |
nucho | 0:b14546a3cfab | 44 | } |
nucho | 0:b14546a3cfab | 45 | #endif |