Skip to content

Commit

Permalink
zap generation 2
Browse files Browse the repository at this point in the history
  • Loading branch information
pgregorr-amazon committed Feb 19, 2024
1 parent 6a97a13 commit 8d337bd
Show file tree
Hide file tree
Showing 25 changed files with 2,466 additions and 4,034 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
/* Begin PBXBuildFile section */
3907B30D2B7C3CDA00EBD369 /* MCAttributeObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3907B30C2B7C3CDA00EBD369 /* MCAttributeObjects.mm */; };
3907B30F2B7C3D0900EBD369 /* MCAttributeObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 3907B30E2B7C3D0900EBD369 /* MCAttributeObjects.h */; };
39CEEF162B7D7EB2007EFC1C /* MCClusterObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 39CEEF152B7D7EB2007EFC1C /* MCClusterObjects.h */; };
39CEEF1A2B7D800B007EFC1C /* MCClusterObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39CEEF192B7D800B007EFC1C /* MCClusterObjects.mm */; };
39CEEF1C2B7D80A4007EFC1C /* MCCommandObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39CEEF1B2B7D80A4007EFC1C /* MCCommandObjects.mm */; };
39CEEF202B7D80D0007EFC1C /* MCCommandObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 39CEEF1F2B7D80D0007EFC1C /* MCCommandObjects.h */; };
3C0474062B3F7E5F0012AE95 /* MCEndpointFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C0474052B3F7E5F0012AE95 /* MCEndpointFilter.h */; };
3C04740C2B4604CF0012AE95 /* MCCryptoUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C04740B2B4604CF0012AE95 /* MCCryptoUtils.h */; };
3C04740E2B4605B40012AE95 /* MCCryptoUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C04740D2B4605B40012AE95 /* MCCryptoUtils.mm */; };
Expand Down Expand Up @@ -44,8 +48,6 @@
3C621CA72B605AA1005CDBA3 /* MCObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA62B605AA1005CDBA3 /* MCObserver.h */; };
3C621CA92B605C52005CDBA3 /* MCAttribute_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CA82B605C52005CDBA3 /* MCAttribute_Internal.h */; };
3C621CAB2B605C6E005CDBA3 /* MCAttribute.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C621CAA2B605C6E005CDBA3 /* MCAttribute.mm */; };
3C621CAD2B605E94005CDBA3 /* MCAttributeObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C621CAC2B605E94005CDBA3 /* MCAttributeObjects.h */; };
3C621CAF2B605EA7005CDBA3 /* MCAttributeObjects.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C621CAE2B605EA7005CDBA3 /* MCAttributeObjects.mm */; };
3C66FBFC290327BB00B63FE7 /* AppParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C66FBFB290327BB00B63FE7 /* AppParameters.mm */; };
3C6920462AA1093300D0F613 /* MCDeviceAttestationCredentialsProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C6920452AA1093300D0F613 /* MCDeviceAttestationCredentialsProvider.h */; };
3C6920482AA1094000D0F613 /* MCDeviceAttestationCredentialsProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C6920472AA1094000D0F613 /* MCDeviceAttestationCredentialsProvider.mm */; };
Expand Down Expand Up @@ -84,6 +86,10 @@
/* Begin PBXFileReference section */
3907B30C2B7C3CDA00EBD369 /* MCAttributeObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCAttributeObjects.mm; sourceTree = "<group>"; };
3907B30E2B7C3D0900EBD369 /* MCAttributeObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAttributeObjects.h; sourceTree = "<group>"; };
39CEEF152B7D7EB2007EFC1C /* MCClusterObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCClusterObjects.h; sourceTree = "<group>"; };
39CEEF192B7D800B007EFC1C /* MCClusterObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCClusterObjects.mm; sourceTree = "<group>"; };
39CEEF1B2B7D80A4007EFC1C /* MCCommandObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCommandObjects.mm; sourceTree = "<group>"; };
39CEEF1F2B7D80D0007EFC1C /* MCCommandObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCommandObjects.h; sourceTree = "<group>"; };
3C0474052B3F7E5F0012AE95 /* MCEndpointFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCEndpointFilter.h; sourceTree = "<group>"; };
3C04740B2B4604CF0012AE95 /* MCCryptoUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCCryptoUtils.h; sourceTree = "<group>"; };
3C04740D2B4605B40012AE95 /* MCCryptoUtils.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCCryptoUtils.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -124,8 +130,6 @@
3C621CA62B605AA1005CDBA3 /* MCObserver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCObserver.h; sourceTree = "<group>"; };
3C621CA82B605C52005CDBA3 /* MCAttribute_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAttribute_Internal.h; sourceTree = "<group>"; };
3C621CAA2B605C6E005CDBA3 /* MCAttribute.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCAttribute.mm; sourceTree = "<group>"; };
3C621CAC2B605E94005CDBA3 /* MCAttributeObjects.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCAttributeObjects.h; sourceTree = "<group>"; usesTabs = 0; };
3C621CAE2B605EA7005CDBA3 /* MCAttributeObjects.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MCAttributeObjects.mm; sourceTree = "<group>"; };
3C66FBFA2903279A00B63FE7 /* AppParameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppParameters.h; sourceTree = "<group>"; };
3C66FBFB290327BB00B63FE7 /* AppParameters.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppParameters.mm; sourceTree = "<group>"; };
3C6920452AA1093300D0F613 /* MCDeviceAttestationCredentialsProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MCDeviceAttestationCredentialsProvider.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -186,6 +190,10 @@
children = (
3907B30C2B7C3CDA00EBD369 /* MCAttributeObjects.mm */,
3907B30E2B7C3D0900EBD369 /* MCAttributeObjects.h */,
39CEEF152B7D7EB2007EFC1C /* MCClusterObjects.h */,
39CEEF192B7D800B007EFC1C /* MCClusterObjects.mm */,
39CEEF1B2B7D80A4007EFC1C /* MCCommandObjects.mm */,
39CEEF1F2B7D80D0007EFC1C /* MCCommandObjects.h */,
);
path = "zap-generated";
sourceTree = "<group>";
Expand Down Expand Up @@ -261,8 +269,6 @@
3C4F52352B5733A200BB8A10 /* MCClusterObjects.mm */,
3C621CA02B5F6CF8005CDBA3 /* MCCommandObjects.h */,
3C621CA22B5F6D08005CDBA3 /* MCCommandObjects.mm */,
3C621CAC2B605E94005CDBA3 /* MCAttributeObjects.h */,
3C621CAE2B605EA7005CDBA3 /* MCAttributeObjects.mm */,
3C4F521F2B507C4A00BB8A10 /* MCEndpointClusterType.h */,
3C4F52132B4F31DC00BB8A10 /* MCDeviceTypeStruct.h */,
3C4F52152B4F31FA00BB8A10 /* MCDeviceTypeStruct.m */,
Expand Down Expand Up @@ -332,6 +338,8 @@
3CD6D01A298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h in Headers */,
3CF71C0E2A992DA2003A5CE5 /* MCDataSource.h in Headers */,
3C4F52142B4F31DC00BB8A10 /* MCDeviceTypeStruct.h in Headers */,
39CEEF162B7D7EB2007EFC1C /* MCClusterObjects.h in Headers */,
39CEEF202B7D80D0007EFC1C /* MCCommandObjects.h in Headers */,
3C26AC8C2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp in Headers */,
3C621CA52B605A6A005CDBA3 /* MCAttribute.h in Headers */,
3CD73F1C2A9E8396009D82D1 /* MCCommissionableDataProvider.h in Headers */,
Expand Down Expand Up @@ -360,7 +368,6 @@
3C621CA12B5F6CF8005CDBA3 /* MCCommandObjects.h in Headers */,
3C4F52202B507C4A00BB8A10 /* MCEndpointClusterType.h in Headers */,
3C6920462AA1093300D0F613 /* MCDeviceAttestationCredentialsProvider.h in Headers */,
3C621CAD2B605E94005CDBA3 /* MCAttributeObjects.h in Headers */,
3C04740C2B4604CF0012AE95 /* MCCryptoUtils.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -461,6 +468,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
39CEEF1A2B7D800B007EFC1C /* MCClusterObjects.mm in Sources */,
3CCB8743286A593700771BAD /* CastingServerBridge.mm in Sources */,
3C4E53B228E5184C00F293E8 /* TargetNavigatorTypes.mm in Sources */,
3C6920482AA1094000D0F613 /* MCDeviceAttestationCredentialsProvider.mm in Sources */,
Expand All @@ -474,13 +482,13 @@
3C621CA32B5F6D08005CDBA3 /* MCCommandObjects.mm in Sources */,
3CF71C0C2A992D25003A5CE5 /* MCCastingApp.mm in Sources */,
3C621CAB2B605C6E005CDBA3 /* MCAttribute.mm in Sources */,
39CEEF1C2B7D80A4007EFC1C /* MCCommandObjects.mm in Sources */,
3C4F52122B4E18ED00BB8A10 /* MCEndpoint.mm in Sources */,
3C4E53B028E4F28100F293E8 /* MediaPlaybackTypes.mm in Sources */,
3C04740E2B4605B40012AE95 /* MCCryptoUtils.mm in Sources */,
3C4F52362B5733A200BB8A10 /* MCClusterObjects.mm in Sources */,
3CD73F1E2A9E83C1009D82D1 /* MCCommissionableDataProvider.mm in Sources */,
3CD73F222A9EA078009D82D1 /* MCDeviceAttestationCredentials.mm in Sources */,
3C621CAF2B605EA7005CDBA3 /* MCAttributeObjects.mm in Sources */,
3C2346252B362BBB00FA276E /* MCCastingPlayerDiscovery.mm in Sources */,
3C4F52242B507CA800BB8A10 /* MCCluster.mm in Sources */,
3C66FBFC290327BB00B63FE7 /* AppParameters.mm in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ - (void)write:(id _Nonnull)value withCompletionBlock:(void (^_Nonnull __strong)(
{
}

- (id _Nullable)getObjTypeFromCpp:(std::any)cppValue
- (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue
{
return nil;
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@

- (instancetype _Nonnull)initWithCppAttribute:(void * _Nonnull)cppAttribute;

- (id _Nullable)getObjTypeFromCpp:(std::any)cppValue;
- (id _Nullable)getObjCTypeFromCpp:(std::any)cppValue errorCode:(CHIP_ERROR * _Nonnull)aError;

@end

template <typename TypeInfo>
class MCAttributeTemplate {
public:
MCAttributeTemplate(void * _Nonnull cppAttribute,
std::function<id(std::any)> getObjTypeFromCppFn)
std::function<id(std::any, CHIP_ERROR * _Nonnull)> getObjCTypeFromCppFn)
{
mCppAttribute = cppAttribute;
mGetObjTypeFromCppFn = getObjTypeFromCppFn;
mgetObjCTypeFromCppFn = getObjCTypeFromCppFn;
}

void read(void * _Nullable context, std::function<void(void * _Nullable, id _Nullable, id _Nullable, NSError * _Nullable)> completion)
Expand All @@ -63,11 +63,11 @@ class MCAttributeTemplate {
if (before.HasValue()) {
ChipLogProgress(AppServer, "<MCAttributeTemplate> converting 'before' value from Cpp to ObjC");
std::any anyBefore = std::any(std::make_shared<typename TypeInfo::DecodableArgType>(before.Value()));
objCBefore = mGetObjTypeFromCppFn(anyBefore);
objCBefore = mgetObjCTypeFromCppFn(anyBefore);
}
ChipLogProgress(AppServer, "<MCAttributeTemplate> converting 'after' value from Cpp to ObjC");
std::any anyAfter = std::any(std::make_shared<typename TypeInfo::DecodableArgType>(after));
objCAfter = mGetObjTypeFromCppFn(anyAfter);
objCAfter = mgetObjCTypeFromCppFn(anyAfter);
dispatch_async(clientQueue, ^{
completion(context, objCBefore, objCAfter, nil);
});
Expand All @@ -94,11 +94,11 @@ class MCAttributeTemplate {
if (before.HasValue()) {
ChipLogProgress(AppServer, "<MCAttributeTemplate> converting 'before' value from Cpp to ObjC");
std::any anyBefore = std::any(std::make_shared<typename TypeInfo::DecodableArgType>(before.Value()));
objCBefore = mGetObjTypeFromCppFn(anyBefore);
objCBefore = mgetObjCTypeFromCppFn(anyBefore);
}
ChipLogProgress(AppServer, "<MCAttributeTemplate> converting 'after' value from Cpp to ObjC");
std::any anyAfter = std::any(std::make_shared<typename TypeInfo::DecodableArgType>(after));
objCAfter = mGetObjTypeFromCppFn(anyAfter);
objCAfter = mgetObjCTypeFromCppFn(anyAfter);
dispatch_async(clientQueue, ^{
completion(context, objCBefore, objCAfter, nil);
});
Expand All @@ -115,6 +115,6 @@ class MCAttributeTemplate {

private:
void * _Nonnull mCppAttribute;
std::function<id(std::any)> mGetObjTypeFromCppFn;
std::function<id(std::any)> mgetObjCTypeFromCppFn;
};
#endif /* MCAttribute_Internal_h */
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

#import "MCAttributeObjects.h"
#import "zap-generated/MCAttributeObjects.h"
#import "MCCluster.h"
#import "MCCommandObjects.h"
#import <Foundation/Foundation.h>
Expand Down
Loading

0 comments on commit 8d337bd

Please sign in to comment.