]>
Commit | Line | Data |
---|---|---|
1 | // | |
2 | // KDCirclePeer.m | |
3 | // Security | |
4 | // | |
5 | // Created by J Osborne on 2/25/13. | |
6 | // | |
7 | // | |
8 | ||
9 | #import "KDCirclePeer.h" | |
10 | #include "SecureObjectSync/SOSCloudCircle.h" | |
11 | #include "SecureObjectSync/SOSPeerInfo.h" | |
12 | ||
13 | @interface KDCirclePeer () | |
14 | ||
15 | @property (readwrite) NSString *name; | |
16 | @property (readwrite) NSString *idString; | |
17 | @property (readwrite) id peerObject; | |
18 | ||
19 | @end | |
20 | ||
21 | @implementation KDCirclePeer | |
22 | ||
23 | -(id)initWithPeerObject:(id)peerObject | |
24 | { | |
25 | self = [super init]; | |
26 | if (!self) { | |
27 | return self; | |
28 | } | |
29 | ||
30 | self.peerObject = peerObject; | |
31 | self.name = (__bridge NSString *)(SOSPeerInfoGetPeerName((__bridge SOSPeerInfoRef)peerObject)); | |
32 | self.idString = (__bridge NSString *)(SOSPeerInfoGetPeerID((__bridge SOSPeerInfoRef)peerObject)); | |
33 | ||
34 | return self; | |
35 | } | |
36 | ||
37 | -(NSString*)description | |
38 | { | |
39 | return [NSString stringWithFormat:@"[peer n='%@' id='%@' o=%@]", self.name, self.idString, self.peerObject]; | |
40 | } | |
41 | ||
42 | @end |