-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
PartDefinition.m
executable file
·58 lines (48 loc) · 1010 Bytes
/
PartDefinition.m
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
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// PartDefinition.m
// AVRFuses
//
// Created by Jason von Nieda on 11/16/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import "PartDefinition.h"
@implementation PartDefinition
-(id)init;
{
self = [super init];
fuses = [[NSMutableDictionary alloc] init];
return self;
}
@end
@implementation FuseDefinition
-(id)init;
{
self = [super init];
settings = [[NSMutableArray alloc] init];
return self;
}
@end
@implementation FuseSetting
@end
@implementation Signature
- (NSString*)description
{
return [NSString stringWithFormat:@"%.2x %.2x %.2x", self->s1, self->s2, self->s3];
}
- (BOOL)isEqual: (id)other
{
return [self hash] == [other hash];
}
- (NSUInteger)hash
{
return (self->s1 << 16) + (self->s2 << 8) + self->s3;
}
-(id)copyWithZone:(NSZone*)zone
{
Signature *newSignature = [[[self class] allocWithZone:zone] init];
newSignature->s1 = self->s1;
newSignature->s2 = self->s2;
newSignature->s3 = self->s3;
return newSignature;
}
@end