check correct queue for managed object value access

This commit is contained in:
John Estropia
2017-04-12 19:22:18 +09:00
parent 9f3db61ff7
commit a73306fecb
10 changed files with 239 additions and 40 deletions

View File

@@ -84,6 +84,10 @@ public enum RelationshipContainer<O: CoreStoreObject> {
get {
CoreStore.assert(
self.accessRawObject().isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
)
return self.accessRawObject()
.getValue(
forKvcKey: self.keyPath,
@@ -92,6 +96,10 @@ public enum RelationshipContainer<O: CoreStoreObject> {
}
set {
CoreStore.assert(
self.accessRawObject().isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
)
self.accessRawObject()
.setValue(
newValue,
@@ -175,6 +183,10 @@ public enum RelationshipContainer<O: CoreStoreObject> {
get {
CoreStore.assert(
self.accessRawObject().isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
)
return self.accessRawObject()
.getValue(
forKvcKey: self.keyPath,
@@ -190,6 +202,10 @@ public enum RelationshipContainer<O: CoreStoreObject> {
}
set {
CoreStore.assert(
self.accessRawObject().isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
)
self.accessRawObject()
.setValue(
newValue,
@@ -279,6 +295,10 @@ public enum RelationshipContainer<O: CoreStoreObject> {
get {
CoreStore.assert(
self.accessRawObject().isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
)
return self.accessRawObject()
.getValue(
forKvcKey: self.keyPath,
@@ -294,6 +314,10 @@ public enum RelationshipContainer<O: CoreStoreObject> {
}
set {
CoreStore.assert(
self.accessRawObject().isRunningInAllowedQueue() == true,
"Attempted to access \(cs_typeName(O.self))'s value outside it's designated queue."
)
self.accessRawObject()
.setValue(
newValue,