pEpObjCAdapter/PEPAutoPointer.m
author Dirk Zimmermann <dz@pep.security>
Thu, 12 Sep 2019 16:41:52 +0200
branchIOSAD-141
changeset 1244 d780d1356405
parent 564 9eba9cef4911
permissions -rw-r--r--
IOSAD-141 Give the threads a name.
     1 //
     2 //  PEPAutoPointer.m
     3 //  pEpObjCAdapter
     4 //
     5 //  Created by Dirk Zimmermann on 11.04.18.
     6 //  Copyright © 2018 p≡p. All rights reserved.
     7 //
     8 
     9 #import "PEPAutoPointer.h"
    10 
    11 @interface PEPAutoPointer ()
    12 
    13 @property (nonatomic) void *thePointer;
    14 
    15 @end
    16 
    17 @implementation PEPAutoPointer
    18 
    19 - (void **)voidPointerPointer
    20 {
    21     return &_thePointer;
    22 }
    23 
    24 - (char **)charPointerPointer
    25 {
    26     return (char **) self.voidPointerPointer;
    27 }
    28 
    29 - (void *)voidPointer
    30 {
    31     return self.thePointer;
    32 }
    33 
    34 - (char *)charPointer
    35 {
    36     return (char *) self.voidPointer;
    37 }
    38 
    39 - (void)dealloc
    40 {
    41     free(_thePointer);
    42 }
    43 
    44 @end