FPendingPut.m 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import "FPendingPut.h"
  17. @implementation FPendingPut
  18. @synthesize path;
  19. @synthesize data;
  20. - (id) initWithPath:(FPath *)aPath andData:(id)aData andPriority:(id)aPriority {
  21. self = [super init];
  22. if (self) {
  23. self.path = aPath;
  24. self.data = aData;
  25. self.priority = aPriority;
  26. }
  27. return self;
  28. }
  29. - (void)encodeWithCoder:(NSCoder *)aCoder {
  30. [aCoder encodeObject:[self.path description] forKey:@"path"];
  31. [aCoder encodeObject:self.data forKey:@"data"];
  32. [aCoder encodeObject:self.priority forKey:@"priority"];
  33. }
  34. - (id)initWithCoder:(NSCoder *)aDecoder {
  35. self = [super init];
  36. if(self) {
  37. self.path = [[FPath alloc] initWith:[aDecoder decodeObjectForKey:@"path"]];
  38. self.data = [aDecoder decodeObjectForKey:@"data"];
  39. self.priority = [aDecoder decodeObjectForKey:@"priority"];
  40. }
  41. return self;
  42. }
  43. @end
  44. @implementation FPendingPutPriority
  45. @synthesize path;
  46. @synthesize priority;
  47. - (id) initWithPath:(FPath *)aPath andPriority:(id)aPriority {
  48. self = [super init];
  49. if (self) {
  50. self.path = aPath;
  51. self.priority = aPriority;
  52. }
  53. return self;
  54. }
  55. - (void)encodeWithCoder:(NSCoder *)aCoder {
  56. [aCoder encodeObject:[self.path description] forKey:@"path"];
  57. [aCoder encodeObject:self.priority forKey:@"priority"];
  58. }
  59. - (id)initWithCoder:(NSCoder *)aDecoder {
  60. self = [super init];
  61. if(self) {
  62. self.path = [[FPath alloc] initWith:[aDecoder decodeObjectForKey:@"path"]];
  63. self.priority = [aDecoder decodeObjectForKey:@"priority"];
  64. }
  65. return self;
  66. }
  67. @end
  68. @implementation FPendingUpdate
  69. @synthesize path;
  70. @synthesize data;
  71. - (id) initWithPath:(FPath *)aPath andData:(id)aData {
  72. self = [super init];
  73. if (self) {
  74. self.path = aPath;
  75. self.data = aData;
  76. }
  77. return self;
  78. }
  79. - (void)encodeWithCoder:(NSCoder *)aCoder {
  80. [aCoder encodeObject:[self.path description] forKey:@"path"];
  81. [aCoder encodeObject:self.data forKey:@"data"];
  82. }
  83. - (id)initWithCoder:(NSCoder *)aDecoder {
  84. self = [super init];
  85. if(self) {
  86. self.path = [[FPath alloc] initWith:[aDecoder decodeObjectForKey:@"path"]];
  87. self.data = [aDecoder decodeObjectForKey:@"data"];
  88. }
  89. return self;
  90. }
  91. @end