Skip to content

Commit

Permalink
iox-#27 Add UntypedServer and UntypedServerImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Feb 14, 2022
1 parent 932790b commit e74429c
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 9 deletions.
12 changes: 6 additions & 6 deletions doc/design/diagrams/request_response/untyped_api.puml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class UntypedClient {
disconnect(): void
getConnectionState(): ConnectionState
loan(userPayloadSize: uint32_t, userPayloadAlignment: uint32_t): expected<void*, Error>
send(request: void*): void
freeRequest(request: void*): void
send(requestPayload: void*): void
freeRequest(requestPayload: void*): void
hasResponses(): bool
take(): expected<void*, Error>
releaseResponse(response: void*): void
releaseResponse(responsePayload: void*): void
releaseQueuedResponses(): void
hasMissedResponses(): bool
}
Expand All @@ -23,12 +23,12 @@ class UntypedServer {
hasClients(): bool
hasRequests(): bool
take(): expected<void*, Error>
releaseRequest(request: void*): void
releaseRequest(requestPayload: void*): void
releaseQueuedRequests(): void
hasMissedRequests(): bool
loan(requestHeader: RequestHeader*, userPayloadSize: uint32_t, userPayloadAlignment: uint32_t): expected<void*, Error>
send(response: void*): void
freeResponse(response: void*): void
send(responsePayload: void*): void
freeResponse(responsePayload: void*): void
}

@enduml
6 changes: 3 additions & 3 deletions doc/design/diagrams/request_response/untyped_api.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright (c) 2022 by Apex.AI Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

#ifndef IOX_POSH_POPO_UNTYPED_SERVER_IMPL_HPP
#define IOX_POSH_POPO_UNTYPED_SERVER_IMPL_HPP

#include "iceoryx_posh/capro/service_description.hpp"
#include "iceoryx_posh/internal/popo/base_server.hpp"
#include "iceoryx_posh/popo/server_options.hpp"

namespace iox
{
namespace popo
{
template <typename BaseServerT = BaseServer<>>
class UntypedServerImpl : public BaseServerT
{
public:
explicit UntypedServerImpl(const capro::ServiceDescription& service,
const ServerOptions& serverOptions = {}) noexcept;

cxx::expected<const void*, ServerRequestResult> take() noexcept;
void releaseRequest(const void* const requestPayload) noexcept;

cxx::expected<void*, AllocationError>
loan(const RequestHeader* requestHeader, const uint32_t payloadSize, const uint32_t payloadAlignment) noexcept;
void send(void* const responsePayload) noexcept;
void freeResponse(void* const responsePayload) noexcept;

protected:
using BaseServerT::port;
};
} // namespace popo
} // namespace iox

#include "iceoryx_posh/internal/popo/untyped_server_impl.inl"

#endif // IOX_POSH_POPO_UNTYPED_SERVER_IMPL_HPP
Loading

0 comments on commit e74429c

Please sign in to comment.