diff options
author | Aleksandr Mishchenko <AMishchenko@luxoft.com> | 2020-02-27 10:51:10 +0100 |
---|---|---|
committer | Aleksandr Mishchenko <AMishchenko@luxoft.com> | 2020-02-27 10:51:10 +0100 |
commit | 20bbb94b19a36723576ed17e070c94579e46f9c8 (patch) | |
tree | 61b02c1d30941660c1ca1fdd95e9f2fbd917e505 | |
parent | 209f50079767b81206e8526d193bb94e1fdf1be9 (diff) | |
download | sdl_ios-20bbb94b19a36723576ed17e070c94579e46f9c8.tar.gz |
remove all custom mappings
-rw-r--r-- | generator/mapping.json | 3 | ||||
-rw-r--r-- | generator/templates/enums/FunctionID.h | 29 | ||||
-rw-r--r-- | generator/templates/enums/FunctionID.m | 52 |
3 files changed, 0 insertions, 84 deletions
diff --git a/generator/mapping.json b/generator/mapping.json index e90187f04..60fe362be 100644 --- a/generator/mapping.json +++ b/generator/mapping.json @@ -1,8 +1,5 @@ { "enums": { - "FunctionID": { - "template": true - } }, "structs": { }, diff --git a/generator/templates/enums/FunctionID.h b/generator/templates/enums/FunctionID.h deleted file mode 100644 index 92e36ac29..000000000 --- a/generator/templates/enums/FunctionID.h +++ /dev/null @@ -1,29 +0,0 @@ -{% include 'copyright.txt' %} -// {{name}}.h - -#import <Foundation/Foundation.h> -#import "NSNumber+NumberType.h" -#import "SDLRPCFunctionNames.h" - -NS_ASSUME_NONNULL_BEGIN - -/// A function ID for an SDL RPC -@interface {{name}} : NSObject - -/// The shared object for pulling function id information -+ (instancetype)sharedInstance; - -/// Gets the function name for a given SDL RPC function ID -/// -/// @param functionID A function ID -/// @returns An SDLRPCFunctionName -- (nullable SDLRPCFunctionName)functionNameForId:(UInt32)functionID; - -/// Gets the function ID for a given SDL RPC function name -/// -/// @param functionName The RPC function name -- (nullable NSNumber<SDLInt> *)functionIdForName:(SDLRPCFunctionName)functionName; - -@end - -NS_ASSUME_NONNULL_END diff --git a/generator/templates/enums/FunctionID.m b/generator/templates/enums/FunctionID.m deleted file mode 100644 index 92ddacafc..000000000 --- a/generator/templates/enums/FunctionID.m +++ /dev/null @@ -1,52 +0,0 @@ -{% include 'copyright.txt' %} -// {{name}}.m - -#import "{{name}}.h" - -#import "NSMutableDictionary+Store.h" -#import "SDLRPCFunctionNames.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface {{name}} () - -@property (nonatomic, strong, nonnull) NSDictionary* functionIds; - -@end - -@implementation {{name}} - -+ (instancetype)sharedInstance { - static {{name}}* functionId = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - functionId = [[{{name}} alloc] init]; - }); - return functionId; -} - -- (instancetype)init { - self = [super init]; - if (!self) { - return nil; - } - - self.functionIds = @{ - {%- for param in params %} - @{{param.value}}: SDLRPCFunctionName{{param.name}}{{ ',' if not loop.last }} - {%- endfor %} - }; - return self; -} - -- (nullable SDLRPCFunctionName)functionNameForId:(UInt32)functionID { - return self.functionIds[@(functionID)]; -} - -- (nullable NSNumber<SDLInt> *)functionIdForName:(SDLRPCFunctionName)functionName { - return [[self.functionIds allKeysForObject:functionName] firstObject]; -} - -@end - -NS_ASSUME_NONNULL_END |