CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
semaphore.h
1
2#pragma once
3#include "system/object.h"
4#include "system/threading/wait_handle.h"
5#include <memory>
6
7namespace System { namespace Threading {
8
9class SemaphoreHandler;
10
15class ASPOSECPP_SHARED_CLASS Semaphore : public WaitHandle
16{
18 RTTI_INFO(System::Threading::Semaphore, ::System::BaseTypesInfo<System::Threading::WaitHandle>);
19
20public:
24 ASPOSECPP_SHARED_API Semaphore(int initialCount, int maximumCount);
29 ASPOSECPP_SHARED_API Semaphore(int initialCount, int maximumCount, const String& name);
35 ASPOSECPP_SHARED_API Semaphore(int initialCount, int maximumCount, const String& name, bool& createdNew);
36
38 virtual ASPOSECPP_SHARED_API bool Reset();
40 virtual ASPOSECPP_SHARED_API bool Set();
41
44 virtual ASPOSECPP_SHARED_API bool WaitOne() override;
48 virtual ASPOSECPP_SHARED_API bool WaitOne(int millisecondsTimeout) override;
51 ASPOSECPP_SHARED_API int Release();
55 ASPOSECPP_SHARED_API int Release(int releaseCount);
56
57private:
59 std::shared_ptr<SemaphoreHandler> m_semaphore_handler;
60
66 void CheckArguments(int initialCount, int maximumCount);
72 void ConstructNamed(int initialCount, int maximumCount, const String &name, bool &createdNew);
73};
74
75
76}} // namespace System{ namespace Threading{
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Semaphore implementation. Objects of this class should only be allocated using System::MakeObject() f...
Definition: semaphore.h:16
int Release()
Releases lock on semaphore.
int Release(int releaseCount)
Releases multiple locks on semaphore.
Semaphore(int initialCount, int maximumCount, const String &name)
Creates named semaphore.
virtual bool Reset()
Sets semaphore to non-signalled state. Not supported.
virtual bool WaitOne() override
Locks semaphore. Performs unlimited waiting if neccessary.
virtual bool WaitOne(int millisecondsTimeout) override
Locks semaphore. Performs waiting if neccessary.
virtual bool Set()
Sets semaphore to signalled state. Not supported.
Semaphore(int initialCount, int maximumCount, const String &name, bool &createdNew)
Creates named semaphore.
Semaphore(int initialCount, int maximumCount)
Creates unnamed semaphore.
Waiting primitive base class. Objects of this class should only be allocated using System::MakeObject...
Definition: wait_handle.h:20
Definition: db_command.h:9