-
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.
Merge branch 'ni:master' into new-testing-suite
- Loading branch information
Showing
20 changed files
with
520 additions
and
37 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
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 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
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.