- update class and function comments

pull/26/head
Simon Gockner 6 years ago
parent 70ed41ed54
commit 648045e5b4
  1. 235
      GBase.Client/GBase.Client.xml
  2. 24
      GBase.Client/GBaseClient.cs
  3. 47
      GBase.Client/GBaseClientSettings.cs
  4. 14
      GBase.Client/Interfaces/IGBaseClient.cs
  5. 14
      GBase.Client/Interfaces/IGBaseClientSettings.cs
  6. 11
      GBase.Client/Services/GBaseEntryService.cs
  7. 16
      GBase.Client/Services/GBaseService.cs
  8. 11
      GBase.Client/Services/GBaseTableService.cs
  9. 31
      GBase.Client/Services/Service.cs

@ -4,5 +4,240 @@
<name>GBase.Client</name>
</assembly>
<members>
<member name="T:GBase.Client.GBaseClient">
<summary>
A client for the GBase
</summary>
</member>
<member name="M:GBase.Client.GBaseClient.#ctor(GBase.Client.Interfaces.IGBaseClientSettings)">
<summary>
A client for the GBase
</summary>
<param name="settings">The <see cref="T:GBase.Client.Interfaces.IGBaseClientSettings"/> for this client</param>
</member>
<member name="P:GBase.Client.GBaseClient.GBase">
<summary>
Functions of the GBase
</summary>
</member>
<member name="P:GBase.Client.GBaseClient.GBaseTable">
<summary>
Functions of the GBaseTable
</summary>
</member>
<member name="P:GBase.Client.GBaseClient.GBaseEntry">
<summary>
Functions of the GBaseEntry
</summary>
</member>
<member name="M:GBase.Client.GBaseClient.DisposeAsync">
<summary>
Dispose used resources asynchronously
</summary>
<returns>A <see cref="T:System.Threading.Tasks.ValueTask"/> to await</returns>
</member>
<member name="T:GBase.Client.GBaseClientSettings">
<summary>
Settings for an <see cref="T:GBase.Client.Interfaces.IGBaseClient"/>
</summary>
</member>
<member name="M:GBase.Client.GBaseClientSettings.#ctor(GBase.Api.Communication.ServerProtocol,System.Net.IPAddress,System.Int32,System.String,System.String,System.String)">
<summary>
Settings for an <see cref="T:GBase.Client.Interfaces.IGBaseClient"/>
</summary>
<param name="protocol">The <see cref="T:GBase.Api.Communication.ServerProtocol"/></param>
<param name="ipAddress">The <see cref="T:System.Net.IPAddress"/></param>
<param name="port">The port</param>
<param name="gBaseEndpoint">The GBase endpoint</param>
<param name="gBaseTableEndpoint">The GBaseTable endpoint</param>
<param name="gBaseEntryEndpoint">The GBaseEntry endpoint</param>
</member>
<member name="P:GBase.Client.GBaseClientSettings.Protocol">
<summary>
Protocol that the <see cref="T:GBase.Client.Interfaces.IGBaseClient"/> should use
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.IpAddress">
<summary>
<see cref="T:System.Net.IPAddress"/> that the server listens to
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.Port">
<summary>
Port that the server listens to
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.GBaseEndpoint">
<summary>
GBase endpoint the server listens to
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.GBaseTableEndpoint">
<summary>
GBaseTable endpoint the server listens to
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.GBaseEntryEndpoint">
<summary>
GBaseEntry endpoint the server listens to
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.ServerProtocolGBaseEndpointAddress">
<summary>
Complete GBase endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.ServerProtocolGBaseTableEndpointAddress">
<summary>
Complete GBaseTable endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="P:GBase.Client.GBaseClientSettings.ServerProtocolGBaseEntryEndpointAddress">
<summary>
Complete GBaseEntry endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="T:GBase.Client.Interfaces.IGBaseClient">
<summary>
A client for the GBase
</summary>
</member>
<member name="P:GBase.Client.Interfaces.IGBaseClient.GBase">
<summary>
Functions of the GBase
</summary>
</member>
<member name="P:GBase.Client.Interfaces.IGBaseClient.GBaseTable">
<summary>
Functions of the GBaseTable
</summary>
</member>
<member name="P:GBase.Client.Interfaces.IGBaseClient.GBaseEntry">
<summary>
Functions of the GBaseEntry
</summary>
</member>
<member name="T:GBase.Client.Interfaces.IGBaseClientSettings">
<summary>
Settings for an <see cref="T:GBase.Client.Interfaces.IGBaseClient"/>
</summary>
</member>
<member name="P:GBase.Client.Interfaces.IGBaseClientSettings.ServerProtocolGBaseEndpointAddress">
<summary>
Complete GBase endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="P:GBase.Client.Interfaces.IGBaseClientSettings.ServerProtocolGBaseTableEndpointAddress">
<summary>
Complete GBaseTable endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="P:GBase.Client.Interfaces.IGBaseClientSettings.ServerProtocolGBaseEntryEndpointAddress">
<summary>
Complete GBaseEntry endpoint address based on the <see cref="T:GBase.Api.Communication.ICommunicationSettings"/>
</summary>
</member>
<member name="T:GBase.Client.Services.GBaseEntryService">
<summary>
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBaseEntry
</summary>
</member>
<member name="M:GBase.Client.Services.GBaseEntryService.#ctor(GBase.Api.Communication.ServerProtocol,System.String)">
<summary>
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBaseEntry
</summary>
<param name="serverProtocol">The <see cref="T:GBase.Api.Communication.ServerProtocol"/></param>
<param name="endpoint">The endpoint for the GBaseEntry</param>
</member>
<member name="M:GBase.Client.Services.GBaseEntryService.Dummy">
<summary>
Dummy method
</summary>
</member>
<member name="T:GBase.Client.Services.GBaseService">
<summary>
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBase
</summary>
</member>
<member name="M:GBase.Client.Services.GBaseService.#ctor(GBase.Api.Communication.ServerProtocol,System.String)">
<summary>
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBase
</summary>
<param name="serverProtocol">The <see cref="T:GBase.Api.Communication.ServerProtocol"/></param>
<param name="endpoint">The endpoint for the GBase</param>
</member>
<member name="M:GBase.Client.Services.GBaseService.AddTable">
<summary>
Add a table to the GBase
</summary>
<returns>True if successful, false if not</returns>
</member>
<member name="M:GBase.Client.Services.GBaseService.RemoveTable">
<summary>
Remove a table from the GBase
</summary>
<returns>True if successful, false if not</returns>
</member>
<member name="T:GBase.Client.Services.GBaseTableService">
<summary>
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBaseTable
</summary>
</member>
<member name="M:GBase.Client.Services.GBaseTableService.#ctor(GBase.Api.Communication.ServerProtocol,System.String)">
<summary>
<see cref="T:GBase.Client.Services.Service`1"/> for the IGBaseTable
</summary>
<param name="serverProtocol">The <see cref="T:GBase.Api.Communication.ServerProtocol"/></param>
<param name="endpoint">The endpoint for the GBaseTable</param>
</member>
<member name="M:GBase.Client.Services.GBaseTableService.Dummy">
<summary>
Dummy method
</summary>
</member>
<member name="T:GBase.Client.Services.Service`1">
<summary>
Base class for services of the <see cref="T:GBase.Client.Interfaces.IGBaseClient"/>
</summary>
<typeparam name="TService">The <see cref="T:System.Type"/> of the inheriting service</typeparam>
</member>
<member name="M:GBase.Client.Services.Service`1.#ctor(GBase.Api.Communication.ServerProtocol,System.String)">
<summary>
Base class for services of the <see cref="T:GBase.Client.Interfaces.IGBaseClient"/>
</summary>
<param name="serverProtocol">The <see cref="T:GBase.Api.Communication.ServerProtocol"/></param>
<param name="endpoint">The endpoint for this <typeparamref name="TService"/></param>
</member>
<member name="P:GBase.Client.Services.Service`1.ServiceFactory">
<summary>
The <see cref="T:System.ServiceModel.ChannelFactory`1"/> for this <typeparamref name="TService"/>
</summary>
</member>
<member name="M:GBase.Client.Services.Service`1.OpenFactory(GBase.Api.Communication.ServerProtocol,System.String)">
<summary>
Open a <see cref="T:System.ServiceModel.ChannelFactory`1"/> for the given <see cref="T:GBase.Api.Communication.ServerProtocol"/> and endpoint
</summary>
<param name="serverProtocol">The <see cref="T:GBase.Api.Communication.ServerProtocol"/></param>
<param name="endpoint">The endpoint for this <typeparamref name="TService"/></param>
<returns></returns>
</member>
<member name="M:GBase.Client.Services.Service`1.OpenChannel">
<summary>
Open an <see cref="T:System.ServiceModel.IClientChannel"/> for this <typeparamref name="TService"/>
</summary>
<returns>The opened channel of type <typeparamref name="TService"/></returns>
</member>
<member name="M:GBase.Client.Services.Service`1.CloseChannel(`0)">
<summary>
Close the <see cref="T:System.ServiceModel.IClientChannel"/> for a given <typeparamref name="TService"/>
</summary>
<param name="service">The <typeparamref name="TService"/></param>
</member>
<member name="M:GBase.Client.Services.Service`1.DisposeAsync">
<summary>
Dispose used resources asynchronously
</summary>
<returns>A <see cref="T:System.Threading.Tasks.ValueTask"/> to await</returns>
</member>
</members>
</doc>

@ -9,8 +9,15 @@ using GBase.Client.Services;
namespace GBase.Client
{
/// <summary>
/// A client for the GBase
/// </summary>
public class GBaseClient : IGBaseClient //TODO: Add logging?
{
/// <summary>
/// A client for the GBase
/// </summary>
/// <param name="settings">The <see cref="IGBaseClientSettings"/> for this client</param>
public GBaseClient(IGBaseClientSettings settings)
{
GBase = new GBaseService(settings.Protocol, settings.ServerProtocolGBaseEndpointAddress);
@ -18,12 +25,25 @@ namespace GBase.Client
GBaseEntry = new GBaseEntryService(settings.Protocol, settings.ServerProtocolGBaseEntryEndpointAddress);
}
/// <summary>
/// Functions of the GBase
/// </summary>
public IGBaseService GBase { get; }
/// <summary>
/// Functions of the GBaseTable
/// </summary>
public IGBaseTableService GBaseTable { get; }
public IGBaseEntryService GBaseEntry { get; }
/// <summary>
/// Functions of the GBaseEntry
/// </summary>
public IGBaseEntryService GBaseEntry { get; }
/// <summary>
/// Dispose used resources asynchronously
/// </summary>
/// <returns>A <see cref="ValueTask"/> to await</returns>
public async ValueTask DisposeAsync()
{
await GBase.DisposeAsync();

@ -8,8 +8,20 @@ using GBase.Client.Interfaces;
namespace GBase.Client
{
/// <summary>
/// Settings for an <see cref="IGBaseClient"/>
/// </summary>
public class GBaseClientSettings : IGBaseClientSettings
{
/// <summary>
/// Settings for an <see cref="IGBaseClient"/>
/// </summary>
/// <param name="protocol">The <see cref="ServerProtocol"/></param>
/// <param name="ipAddress">The <see cref="IPAddress"/></param>
/// <param name="port">The port</param>
/// <param name="gBaseEndpoint">The GBase endpoint</param>
/// <param name="gBaseTableEndpoint">The GBaseTable endpoint</param>
/// <param name="gBaseEntryEndpoint">The GBaseEntry endpoint</param>
public GBaseClientSettings(ServerProtocol protocol, IPAddress ipAddress, int port, string gBaseEndpoint, string gBaseTableEndpoint, string gBaseEntryEndpoint)
{
Protocol = protocol;
@ -20,15 +32,50 @@ namespace GBase.Client
GBaseEntryEndpoint = gBaseEntryEndpoint;
}
/// <summary>
/// Protocol that the <see cref="IGBaseClient"/> should use
/// </summary>
public ServerProtocol Protocol { get; }
/// <summary>
/// <see cref="IPAddress"/> that the server listens to
/// </summary>
public IPAddress IpAddress { get; }
/// <summary>
/// Port that the server listens to
/// </summary>
public int Port { get; }
/// <summary>
/// GBase endpoint the server listens to
/// </summary>
public string GBaseEndpoint { get; }
/// <summary>
/// GBaseTable endpoint the server listens to
/// </summary>
public string GBaseTableEndpoint { get; }
/// <summary>
/// GBaseEntry endpoint the server listens to
/// </summary>
public string GBaseEntryEndpoint { get; }
/// <summary>
/// Complete GBase endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
public string ServerProtocolGBaseEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseEndpoint}";
/// <summary>
/// Complete GBaseTable endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
public string ServerProtocolGBaseTableEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseTableEndpoint}";
/// <summary>
/// Complete GBaseEntry endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
public string ServerProtocolGBaseEntryEndpointAddress => @$"{Protocol.GetProtocolString()}{IpAddress}:{Port}{GBaseEntryEndpoint}";
}
}

@ -7,10 +7,24 @@ using GBase.Api.Services;
namespace GBase.Client.Interfaces
{
/// <summary>
/// A client for the GBase
/// </summary>
public interface IGBaseClient : IAsyncDisposable
{
/// <summary>
/// Functions of the GBase
/// </summary>
IGBaseService GBase { get; }
/// <summary>
/// Functions of the GBaseTable
/// </summary>
IGBaseTableService GBaseTable { get; }
/// <summary>
/// Functions of the GBaseEntry
/// </summary>
IGBaseEntryService GBaseEntry { get; }
}
}

@ -6,10 +6,24 @@ using GBase.Api.Communication;
namespace GBase.Client.Interfaces
{
/// <summary>
/// Settings for an <see cref="IGBaseClient"/>
/// </summary>
public interface IGBaseClientSettings : ICommunicationSettings
{
/// <summary>
/// Complete GBase endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
string ServerProtocolGBaseEndpointAddress { get; }
/// <summary>
/// Complete GBaseTable endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
string ServerProtocolGBaseTableEndpointAddress { get; }
/// <summary>
/// Complete GBaseEntry endpoint address based on the <see cref="ICommunicationSettings"/>
/// </summary>
string ServerProtocolGBaseEntryEndpointAddress { get; }
}
}

@ -7,14 +7,25 @@ using GBase.Api.Services;
namespace GBase.Client.Services
{
/// <summary>
/// <see cref="Service{TService}"/> for the IGBaseEntry
/// </summary>
public class GBaseEntryService : Service<IGBaseEntryService>, IGBaseEntryService
{
/// <summary>
/// <see cref="Service{TService}"/> for the IGBaseEntry
/// </summary>
/// <param name="serverProtocol">The <see cref="ServerProtocol"/></param>
/// <param name="endpoint">The endpoint for the GBaseEntry</param>
public GBaseEntryService(ServerProtocol serverProtocol, string endpoint)
: base(serverProtocol, endpoint)
{
}
/// <summary>
/// Dummy method
/// </summary>
public void Dummy()
{
throw new System.NotImplementedException();

@ -7,14 +7,26 @@ using GBase.Api.Services;
namespace GBase.Client.Services
{
/// <summary>
/// <see cref="Service{TService}"/> for the IGBase
/// </summary>
public class GBaseService : Service<IGBaseService>, IGBaseService
{
/// <summary>
/// <see cref="Service{TService}"/> for the IGBase
/// </summary>
/// <param name="serverProtocol">The <see cref="ServerProtocol"/></param>
/// <param name="endpoint">The endpoint for the GBase</param>
public GBaseService(ServerProtocol serverProtocol, string endpoint)
: base(serverProtocol, endpoint)
{
}
/// <summary>
/// Add a table to the GBase
/// </summary>
/// <returns>True if successful, false if not</returns>
public bool AddTable() //TODO: Implement this function correctly
{
IGBaseService channel = OpenChannel();
@ -25,6 +37,10 @@ namespace GBase.Client.Services
return success;
}
/// <summary>
/// Remove a table from the GBase
/// </summary>
/// <returns>True if successful, false if not</returns>
public bool RemoveTable() //TODO: Implement this function correctly
{
IGBaseService channel = OpenChannel();

@ -7,14 +7,25 @@ using GBase.Api.Services;
namespace GBase.Client.Services
{
/// <summary>
/// <see cref="Service{TService}"/> for the IGBaseTable
/// </summary>
public class GBaseTableService : Service<IGBaseTableService>, IGBaseTableService
{
/// <summary>
/// <see cref="Service{TService}"/> for the IGBaseTable
/// </summary>
/// <param name="serverProtocol">The <see cref="ServerProtocol"/></param>
/// <param name="endpoint">The endpoint for the GBaseTable</param>
public GBaseTableService(ServerProtocol serverProtocol, string endpoint)
: base(serverProtocol, endpoint)
{
}
/// <summary>
/// Dummy method
/// </summary>
public void Dummy()
{
throw new System.NotImplementedException();

@ -6,18 +6,37 @@ using System;
using System.ServiceModel;
using System.Threading.Tasks;
using GBase.Api.Communication;
using GBase.Client.Interfaces;
namespace GBase.Client.Services
{
/// <summary>
/// Base class for services of the <see cref="IGBaseClient"/>
/// </summary>
/// <typeparam name="TService">The <see cref="Type"/> of the inheriting service</typeparam>
public abstract class Service<TService> : IAsyncDisposable
{
/// <summary>
/// Base class for services of the <see cref="IGBaseClient"/>
/// </summary>
/// <param name="serverProtocol">The <see cref="ServerProtocol"/></param>
/// <param name="endpoint">The endpoint for this <typeparamref name="TService"/></param>
protected Service(ServerProtocol serverProtocol, string endpoint)
{
ServiceFactory = OpenFactory(serverProtocol, endpoint);
}
/// <summary>
/// The <see cref="ChannelFactory{TChannel}"/> for this <typeparamref name="TService"/>
/// </summary>
private ChannelFactory<TService> ServiceFactory { get; }
/// <summary>
/// Open a <see cref="ChannelFactory{TChannel}"/> for the given <see cref="ServerProtocol"/> and endpoint
/// </summary>
/// <param name="serverProtocol">The <see cref="ServerProtocol"/></param>
/// <param name="endpoint">The endpoint for this <typeparamref name="TService"/></param>
/// <returns></returns>
private ChannelFactory<TService> OpenFactory(ServerProtocol serverProtocol, string endpoint)
{
ChannelFactory<TService> factory;
@ -32,6 +51,10 @@ namespace GBase.Client.Services
return factory;
}
/// <summary>
/// Open an <see cref="IClientChannel"/> for this <typeparamref name="TService"/>
/// </summary>
/// <returns>The opened channel of type <typeparamref name="TService"/></returns>
protected TService OpenChannel()
{
TService channel = ServiceFactory.CreateChannel();
@ -40,11 +63,19 @@ namespace GBase.Client.Services
return channel;
}
/// <summary>
/// Close the <see cref="IClientChannel"/> for a given <typeparamref name="TService"/>
/// </summary>
/// <param name="service">The <typeparamref name="TService"/></param>
protected void CloseChannel(TService service)
{
((IClientChannel) service).Close();
}
/// <summary>
/// Dispose used resources asynchronously
/// </summary>
/// <returns>A <see cref="ValueTask"/> to await</returns>
public async ValueTask DisposeAsync()
{
ServiceFactory.Close();

Loading…
Cancel
Save