![](/media/cache/profiles/94aef38441efa3380a3bed3faf1f9d5d.50x50_q85.jpg)
Dependencies: EthernetNetIf NTPClient_NetServices mbed
member.cpp@0:d441275f622f, 2010-08-09 (annotated)
- Committer:
- nucho
- Date:
- Mon Aug 09 07:01:43 2010 +0000
- Revision:
- 0:d441275f622f
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nucho | 0:d441275f622f | 1 | #include "member.h" |
nucho | 0:d441275f622f | 2 | #include "mbed.h" |
nucho | 0:d441275f622f | 3 | |
nucho | 0:d441275f622f | 4 | using namespace mbed; |
nucho | 0:d441275f622f | 5 | |
nucho | 0:d441275f622f | 6 | member::member(char* inName,unsigned int inId) { |
nucho | 0:d441275f622f | 7 | SetName(inName); |
nucho | 0:d441275f622f | 8 | SetId(inId); |
nucho | 0:d441275f622f | 9 | //printf("name:%s\tid:%u",name,id); |
nucho | 0:d441275f622f | 10 | enter=false; |
nucho | 0:d441275f622f | 11 | } |
nucho | 0:d441275f622f | 12 | |
nucho | 0:d441275f622f | 13 | void member::SetName(char* inName){ |
nucho | 0:d441275f622f | 14 | |
nucho | 0:d441275f622f | 15 | /* |
nucho | 0:d441275f622f | 16 | if(name != NULL){ |
nucho | 0:d441275f622f | 17 | delete [] name; |
nucho | 0:d441275f622f | 18 | } |
nucho | 0:d441275f622f | 19 | */ |
nucho | 0:d441275f622f | 20 | name = new char[strlen(inName)+1]; |
nucho | 0:d441275f622f | 21 | strcpy(name,inName); |
nucho | 0:d441275f622f | 22 | return; |
nucho | 0:d441275f622f | 23 | } |
nucho | 0:d441275f622f | 24 | |
nucho | 0:d441275f622f | 25 | void member::SetId(unsigned int inId){ |
nucho | 0:d441275f622f | 26 | id = inId; |
nucho | 0:d441275f622f | 27 | return; |
nucho | 0:d441275f622f | 28 | } |
nucho | 0:d441275f622f | 29 | |
nucho | 0:d441275f622f | 30 | void member::SetEnter(bool inEnter){ |
nucho | 0:d441275f622f | 31 | enter = inEnter; |
nucho | 0:d441275f622f | 32 | return; |
nucho | 0:d441275f622f | 33 | } |
nucho | 0:d441275f622f | 34 | |
nucho | 0:d441275f622f | 35 | char* member::GetName(void){ |
nucho | 0:d441275f622f | 36 | return name; |
nucho | 0:d441275f622f | 37 | } |
nucho | 0:d441275f622f | 38 | |
nucho | 0:d441275f622f | 39 | unsigned int member::GetId(void){ |
nucho | 0:d441275f622f | 40 | return id; |
nucho | 0:d441275f622f | 41 | } |
nucho | 0:d441275f622f | 42 | |
nucho | 0:d441275f622f | 43 | unsigned int member::GetEnter(void){ |
nucho | 0:d441275f622f | 44 | return enter; |
nucho | 0:d441275f622f | 45 | } |
nucho | 0:d441275f622f | 46 | |
nucho | 0:d441275f622f | 47 | void member::Print(void){ |
nucho | 0:d441275f622f | 48 | printf("name:%s\tid:%u\n",name,id); |
nucho | 0:d441275f622f | 49 | } |
nucho | 0:d441275f622f | 50 | |
nucho | 0:d441275f622f | 51 | bool member::CompareId(unsigned int inId){ |
nucho | 0:d441275f622f | 52 | if(inId == id) return true; |
nucho | 0:d441275f622f | 53 | else return false; |
nucho | 0:d441275f622f | 54 | } |
nucho | 0:d441275f622f | 55 | |
nucho | 0:d441275f622f | 56 | /* |
nucho | 0:d441275f622f | 57 | int member::Compare(Object* inObj){ |
nucho | 0:d441275f622f | 58 | int theRet; |
nucho | 0:d441275f622f | 59 | |
nucho | 0:d441275f622f | 60 | theRet = strcmp(name, ((member*)inObj)->GetName()); |
nucho | 0:d441275f622f | 61 | return theRet; |
nucho | 0:d441275f622f | 62 | } |
nucho | 0:d441275f622f | 63 | */ |