summaryrefslogtreecommitdiff
path: root/objective-c/src/IceIAP/EndpointInfoI.mm
blob: e6f0b64b7903b78bf1005b1685830e94742ea418 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// **********************************************************************
//
// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#import <objc/IceIAP/EndpointInfo.h>
#import <EndpointI.h>
#import <LocalObjectI.h>
#import <Util.h>

#include <IceIAP/EndpointInfo.h>

@implementation ICEIAPEndpointInfo (IceIAP)
+(void) load
{
    IceObjC::registerEndpointInfoClass([ICEIAPEndpointInfo class]);
}

-(id) initWithIAPEndpointInfo:(IceIAP::EndpointInfo*)iapEndpointInfo
{
    self = [super initWithEndpointInfo:iapEndpointInfo];
    if(self)
    {
         self->name = toNSString(iapEndpointInfo->name);
         self->manufacturer = toNSString(iapEndpointInfo->manufacturer);
         self->modelNumber = toNSString(iapEndpointInfo->modelNumber);
         self->protocol = toNSString(iapEndpointInfo->protocol);
    }
    return self;
}

+(id) checkedEndpointInfoWithEndpointInfo:(Ice::EndpointInfo*)endpointInfo
{
    IceIAP::EndpointInfo* iapEndpointInfo = dynamic_cast<IceIAP::EndpointInfo*>(endpointInfo);
    if(iapEndpointInfo)
    {
        return [[ICEIAPEndpointInfo alloc] initWithEndpointInfo:iapEndpointInfo];
    }
    return nil;
}
@end