-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding basic cpp files for reflection. This needs a major refactor. * Removing source only on VIs. * First pass of refactor for the cpp code. * Adding a "Generated Descriptors" placeholder VI in the server template. * Adding proto serializer and descriptor VI generator VI. * Adding Serialize Proto, making changes to main.vi * fixing linker errors in Gen Descriptor VI * Adding register descriptors VI for running the server. * Updating the server template library to include the register descriptors VI. * Adding the descriptor registers call during run service. * Fixing linker errors while building a VIPM package. * Fix icons. Fix descriptor generation to not create virtual folders. * Fix linux build error * Fixing error while building a server when one already exists. * Fixing implementation for the extensions APIs. --------- Co-authored-by: chethan.ravindranath <[email protected]> Co-authored-by: Chakith Pattar <[email protected]>
- Loading branch information
1 parent
7ed39a9
commit f0e6881
Showing
21 changed files
with
504 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+8.53 KB
.../Client Server Support New/Server Template/Generated Descriptors/Generated Descriptors.vi
Binary file not shown.
Binary file added
BIN
+15.6 KB
...iew source/Client Server Support New/Server Template/RPC Messages/Register Descriptors.vi
Binary file not shown.
Binary file modified
BIN
+836 Bytes
(100%)
labview source/Client Server Support New/Server Template/Run Service.vi
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
labview source/Client Server Support New/build spec/gRPC Server and Client Template [2].vipb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+684 Bytes
(100%)
labview source/Client Server Support New/gRPC Scripting Tools/Main.vi
Binary file not shown.
Binary file added
BIN
+15.3 KB
...t Server Support New/gRPC Scripting Tools/Proto Parser API/LabVIEW API/Serialize Proto.vi
Binary file not shown.
Binary file modified
BIN
+844 Bytes
(100%)
...ew source/Client Server Support New/gRPC Scripting Tools/Proto Parser API/Proto Parser.vi
Binary file not shown.
Binary file modified
BIN
-12 Bytes
(100%)
...Client Server Support New/gRPC Scripting Tools/Top Level API/Create Type Data Clusters.vi
Binary file not shown.
Binary file added
BIN
+16.9 KB
...ce/Client Server Support New/gRPC Scripting Tools/Top Level API/Generate Descriptor VI.vi
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
labview source/Client Server Support/build spec/gRPC Server and Client Template.vipb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
#include <lv_proto_server_reflection_plugin.h> | ||
#include <grpcpp/impl/server_initializer.h> | ||
#include <grpcpp/server_builder.h> | ||
#include <lv_interop.h> | ||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
using grpc::ServerContext; | ||
using grpc::Status; | ||
using grpc::ServerInitializer; | ||
using grpc::ServerBuilder; | ||
|
||
namespace grpc_labview | ||
{ | ||
LVProtoServerReflectionPlugin* LVProtoServerReflectionPlugin::m_instance = nullptr; | ||
|
||
LVProtoServerReflectionPlugin::LVProtoServerReflectionPlugin() : reflection_service_(new grpc_labview::LVProtoServerReflectionService()) { | ||
} | ||
|
||
std::string LVProtoServerReflectionPlugin::name() { | ||
return "LVProtoServerReflectionPlugin"; | ||
} | ||
|
||
void LVProtoServerReflectionPlugin::InitServer(ServerInitializer* si) { | ||
si->RegisterService(reflection_service_); | ||
} | ||
|
||
void LVProtoServerReflectionPlugin::Finish(ServerInitializer* si) { | ||
reflection_service_->SetServiceList(si->GetServiceList()); | ||
} | ||
|
||
void LVProtoServerReflectionPlugin::ChangeArguments(const ::std::string& name, void* value) { | ||
// TODO | ||
} | ||
|
||
bool LVProtoServerReflectionPlugin::has_async_methods() const { | ||
return false; // TODO | ||
} | ||
bool LVProtoServerReflectionPlugin::has_sync_methods() const { | ||
return true; // TODO | ||
} | ||
|
||
void LVProtoServerReflectionPlugin::AddService(std::string serviceName) { | ||
reflection_service_.get()->AddService(serviceName); | ||
} | ||
|
||
void LVProtoServerReflectionPlugin::AddFileDescriptorProto(const std::string& serializedProto) { | ||
reflection_service_.get()->AddFileDescriptorProto(serializedProto); | ||
} | ||
|
||
LVProtoServerReflectionPlugin* LVProtoServerReflectionPlugin::GetInstance() { | ||
if (m_instance == nullptr) | ||
m_instance = new LVProtoServerReflectionPlugin(); | ||
return m_instance; | ||
} | ||
|
||
void LVProtoServerReflectionPlugin::DeleteInstance() { | ||
m_instance = nullptr; | ||
} | ||
|
||
std::unique_ptr< ::grpc::ServerBuilderPlugin> CreateLVProtoReflection() { | ||
return std::unique_ptr< ::grpc::ServerBuilderPlugin>( | ||
LVProtoServerReflectionPlugin::GetInstance()); | ||
} | ||
|
||
void InitLVProtoReflectionServerBuilderPlugin() { | ||
static struct Initialize { | ||
Initialize() { | ||
::grpc::ServerBuilder::InternalAddPluginFactory(&CreateLVProtoReflection); | ||
} | ||
} initializer; | ||
} | ||
|
||
LIBRARY_EXPORT void DeserializeReflectionInfo(grpc_labview::LStrHandle serializedFileDescriptor) | ||
{ | ||
std::string serializedDescriptorStr = grpc_labview::GetLVString(serializedFileDescriptor); | ||
LVProtoServerReflectionPlugin::GetInstance()->AddFileDescriptorProto(serializedDescriptorStr); | ||
} | ||
} |
Oops, something went wrong.