Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Thrift support #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions PlainElastic.Net.sln
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlainElastic.Net", "src\PlainElastic.Net\PlainElastic.Net.csproj", "{7881C0A1-3020-45AC-944D-36DA5AE2D734}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlainElastic.Net.Tests", "src\PlainElastic.Net.Tests\PlainElastic.Net.Tests.csproj", "{226B2108-D427-410E-A889-FD5D8C494E34}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlainSample", "src\Samples\PlainSample\PlainSample.csproj", "{01D9A114-7E54-4C14-95ED-3C35E3F0A857}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlainElastic.Net.Connection.Thrift", "src\PlainElastic.Net.Connection.Thrift\PlainElastic.Net.Connection.Thrift.csproj", "{704EF910-C4E7-413E-B21F-296EFE732FCF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug - Generator|Any CPU = Debug - Generator|Any CPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7881C0A1-3020-45AC-944D-36DA5AE2D734}.Debug - Generator|Any CPU.ActiveCfg = Debug|Any CPU
{7881C0A1-3020-45AC-944D-36DA5AE2D734}.Debug - Generator|Any CPU.Build.0 = Debug|Any CPU
{7881C0A1-3020-45AC-944D-36DA5AE2D734}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7881C0A1-3020-45AC-944D-36DA5AE2D734}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7881C0A1-3020-45AC-944D-36DA5AE2D734}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7881C0A1-3020-45AC-944D-36DA5AE2D734}.Release|Any CPU.Build.0 = Release|Any CPU
{226B2108-D427-410E-A889-FD5D8C494E34}.Debug - Generator|Any CPU.ActiveCfg = Debug|Any CPU
{226B2108-D427-410E-A889-FD5D8C494E34}.Debug - Generator|Any CPU.Build.0 = Debug|Any CPU
{226B2108-D427-410E-A889-FD5D8C494E34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{226B2108-D427-410E-A889-FD5D8C494E34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{226B2108-D427-410E-A889-FD5D8C494E34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{226B2108-D427-410E-A889-FD5D8C494E34}.Release|Any CPU.Build.0 = Release|Any CPU
{01D9A114-7E54-4C14-95ED-3C35E3F0A857}.Debug - Generator|Any CPU.ActiveCfg = Debug|Any CPU
{01D9A114-7E54-4C14-95ED-3C35E3F0A857}.Debug - Generator|Any CPU.Build.0 = Debug|Any CPU
{01D9A114-7E54-4C14-95ED-3C35E3F0A857}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01D9A114-7E54-4C14-95ED-3C35E3F0A857}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01D9A114-7E54-4C14-95ED-3C35E3F0A857}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01D9A114-7E54-4C14-95ED-3C35E3F0A857}.Release|Any CPU.Build.0 = Release|Any CPU
{704EF910-C4E7-413E-B21F-296EFE732FCF}.Debug - Generator|Any CPU.ActiveCfg = Debug - Generator|Any CPU
{704EF910-C4E7-413E-B21F-296EFE732FCF}.Debug - Generator|Any CPU.Build.0 = Debug - Generator|Any CPU
{704EF910-C4E7-413E-B21F-296EFE732FCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{704EF910-C4E7-413E-B21F-296EFE732FCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{704EF910-C4E7-413E-B21F-296EFE732FCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{704EF910-C4E7-413E-B21F-296EFE732FCF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
27 changes: 27 additions & 0 deletions dep/NetReflector.1.1.2009/NetReflector.1.1.2009.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>NetReflector</id>
<version>1.1.2009</version>
<title>NetReflector</title>
<authors>Owen Rogers and Contributors</authors>
<owners>Owen Rogers and Contributors</owners>
<licenseUrl>https://github.com/ccnet/NetReflector/blob/master/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/ccnet/NetReflector</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>NetReflector is a dynamic reflective populator for the .NET platform.
It uses C# attributes to dynamically construct an object model from a configuration file.
It greatly simplifies building configurable, pluggable applications by handling the mapping.

NetReflector is released under LGPL v3. See the the License URL for more details.

NetReflector is used for instance in CruiseControl.NET (http://www.cruisecontrolnet.org/).</description>
<summary>NetReflector</summary>
<releaseNotes />
<copyright>Copyright © 2004 - 2009 R. Owen Rogers and Contributors</copyright>
<tags>NetReflector</tags>
<references>
<reference file="NetReflector.dll" />
</references>
</metadata>
</package>
Binary file not shown.
1 change: 1 addition & 0 deletions packages/repositories.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\src\PlainElastic.Net.Connection.Thrift\packages.config" />
<repository path="..\src\PlainElastic.Net.Tests\packages.config" />
<repository path="..\src\PlainElastic.Net\packages.config" />
<repository path="..\src\Samples\PlainSample\packages.config" />
Expand Down
141 changes: 141 additions & 0 deletions src/PlainElastic.Net.Connection.Thrift/Collections/THashSet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/

using System.Collections;
using System.Collections.Generic;

namespace PlainElastic.Net.Connection.Thrift.Collections
{
public class THashSet<T> : ICollection<T>
{
#if NET_2_0
TDictSet<T> set = new TDictSet<T>();
#else
private readonly HashSet<T> set = new HashSet<T>();
#endif

public int Count
{
get { return set.Count; }
}

public bool IsReadOnly
{
get { return false; }
}

public void Add(T item)
{
set.Add(item);
}

public void Clear()
{
set.Clear();
}

public bool Contains(T item)
{
return set.Contains(item);
}

public void CopyTo(T[] array, int arrayIndex)
{
set.CopyTo(array, arrayIndex);
}

public IEnumerator GetEnumerator()
{
return set.GetEnumerator();
}

IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return ((IEnumerable<T>) set).GetEnumerator();
}

public bool Remove(T item)
{
return set.Remove(item);
}

#if NET_2_0
private class TDictSet<V> : ICollection<V>
{
Dictionary<V, TDictSet<V>> dict = new Dictionary<V, TDictSet<V>>();

public int Count
{
get { return dict.Count; }
}

public bool IsReadOnly
{
get { return false; }
}

public IEnumerator GetEnumerator()
{
return ((IEnumerable)dict.Keys).GetEnumerator();
}

IEnumerator<V> IEnumerable<V>.GetEnumerator()
{
return dict.Keys.GetEnumerator();
}

public bool Add(V item)
{
if (!dict.ContainsKey(item))
{
dict[item] = this;
return true;
}

return false;
}

void ICollection<V>.Add(V item)
{
Add(item);
}

public void Clear()
{
dict.Clear();
}

public bool Contains(V item)
{
return dict.ContainsKey(item);
}

public void CopyTo(V[] array, int arrayIndex)
{
dict.Keys.CopyTo(array, arrayIndex);
}

public bool Remove(V item)
{
return dict.Remove(item);
}
}
#endif
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate stub for Exortech.NetReflector.ReflectorCollectionAttribute: type is sealed.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate stub for Exortech.NetReflector.InvalidNodeEventHandler: type is sealed.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate stub for Exortech.NetReflector.ReflectorTypeAttribute: type is sealed.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate stub for Exortech.NetReflector.Util.ReflectionUtil: type is sealed.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate stub for Exortech.NetReflector.Util.StringUtil: type is sealed.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate stub for Exortech.NetReflector.ReflectorArrayAttribute: type is sealed.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate stub for Exortech.NetReflector.ReflectorHashAttribute: type is sealed.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.IReflectorAttribute: type is an interface.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.Util.IInstantiator: type is an interface.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.ISerialiserFactory: type is an interface.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.IXmlSerialiser: type is an interface.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.IXmlTypeSerialiser: type is an interface.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.InvalidNodeEventHandler: type is a delegate.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.IXmlMemberSerialiser: type is an interface.
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.Generators.XsdGenerator+ReferencedType: type is not visible to exported or assembly(NetReflector.Fakes).
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.Util.ReflectorMember+ReflectorField: type is not visible to exported or assembly(NetReflector.Fakes).
C:\Projects\PlainElastic.Net\src\PlainElastic.Net.Connection.Thrift\Fakes\NetReflector.fakes : warning : Cannot generate shim for Exortech.NetReflector.Util.ReflectorMember+ReflectorProperty: type is not visible to exported or assembly(NetReflector.Fakes).
Loading