You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@etch.apache.org by sc...@apache.org on 2009/01/30 23:25:07 UTC
svn commit: r739432 [1/9] - in
/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp:
./ Msg/ Support/ Transport/ Transport/Filter/ Transport/Fmt/
Transport/Fmt/Binary/ Util/
Author: sccomer
Date: Fri Jan 30 22:25:03 2009
New Revision: 739432
URL: http://svn.apache.org/viewvc?rev=739432&view=rev
Log:
refactored csharp binding runtime namespace from Etch to Org.Apache.Etch.Bindings.Csharp.
Added:
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/AsyncMode.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ComboValidator.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Direction.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Field.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/FieldMap.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdName.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdNameMap.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ImportExportHelper.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Message.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/StructValue.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/TypeMap.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Validator.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ValueFactory.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/XType.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/AuthExceptionSerializer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Class2TypeMap.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/DefaultServerFactory.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/DefaultValueFactory.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/DeliveryService.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/DummyValueFactory.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/FreePool.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Mailbox.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/NullPool.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/ObjSession.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Pool.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/QueuedPool.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/RemoteBase.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/RuntimeExceptionSerializer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/ServerFactory.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/StubBase.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/StubHelper.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/TransportFactory.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/TransportHelper.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/TypeValidator.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_RuntimeException.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_StructValue.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_boolean.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_byte.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_custom.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_double.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_float.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_int.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_long.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_object.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_short.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_string.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/Validator_void.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/_Etch_AuthException.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/_Etch_RuntimeException.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/ArrayValue.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/DefaultDeliveryService.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Filter/
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Filter/AbstractMessageFilter.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Filter/KeepAlive.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Filter/Logger.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Filter/PwAuth.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/Binary/
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/Binary/BinaryTaggedData.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/Binary/BinaryTaggedDataFormatFactory.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/Binary/BinaryTaggedDataInput.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/Binary/BinaryTaggedDataOutput.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/Binary/Validator_none.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/ByteToSbyteConverter.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/TaggedData.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Fmt/TypeCode.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/FormatFactory.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/MailboxManager.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/Messagizer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/PlainMailbox.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/PlainMailboxManager.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/SessionMessage.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/TaggedDataInput.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/TaggedDataOutput.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/TcpTransportFactory.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/TransportMessage.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Transport/UnwantedMessage.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/AbstractStartable.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/AlarmListener.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/AlarmManager.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/ArrayIterator.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Assertion.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/CharIterator.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/CircularQueue.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Connection.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/DateSerializer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/EmptyIterator.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/EqualsHelper.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/FlexBuffer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/HPTimer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/IdGenerator.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/InputStream.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/IntCounter.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Integer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/ListSerializer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/MapSerializer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Monitor.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/OutputStream.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Packetizer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/PerfTest.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Resources.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Runner.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/RunnerHandler.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Session.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/SessionConsts.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/SessionData.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/SessionListener.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/SessionPacket.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/SingleIterator.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Startable.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/StrIntHashMap.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/StrIntHashMapSerializer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/StrStrHashMap.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/StrStrHashMapSerializer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/StringTokenizer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/StringUtil.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TcpConnection.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TcpListener.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TcpOptions.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TcpTransport.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Timer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TlsConnection.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Todo.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TodoDelegateImpl.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TodoManager.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Transport.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TransportConsts.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TransportData.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/TransportPacket.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/URL.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/URLSerializer.cs (with props)
incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Util/Who.cs (with props)
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/AsyncMode.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/AsyncMode.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/AsyncMode.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/AsyncMode.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,37 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ ///
+ /// The asynchronous receiver mode of this helper.
+ ///
+ public enum AsyncMode
+ {
+ /// <summary>
+ /// synchronous mode
+ /// </summary>
+ NONE,
+ /// <summary>
+ /// the operation is queued to a thread pool for execution
+ /// </summary>
+ QUEUED,
+ /// <summary>
+ /// the operation is executed by a newly allocated thread
+ /// </summary>
+ FREE
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/AsyncMode.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/AsyncMode.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ComboValidator.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ComboValidator.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ComboValidator.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ComboValidator.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,110 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+using System;
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ /// <summary>
+ /// Validates values using one of two validators
+ /// </summary>
+ public class ComboValidator : Validator
+ {
+ /// <summary>
+ /// Constructs the combo validator
+ /// </summary>
+ /// <param name="a"></param>
+ /// <param name="b"></param>
+ public ComboValidator( Validator a, Validator b )
+ {
+ this.a = a;
+ this.b = b;
+ }
+
+ private readonly Validator a;
+ private readonly Validator b;
+
+ public override string ToString()
+ {
+ return String.Format( "({0} OR {1})", a, b );
+ }
+
+ public override Validator ElementValidator()
+ {
+ Validator na;
+
+ try
+ {
+ na = a.ElementValidator();
+ }
+ catch ( Exception )
+ {
+ na = null;
+ }
+
+ Validator nb;
+ try
+ {
+ nb = b.ElementValidator();
+ }
+ catch ( Exception )
+ {
+ nb = null;
+ }
+
+ if ( na == null && nb == null )
+ throw new ArgumentException( "na == null and nb == null" );
+
+ if ( na == null )
+ return nb;
+
+ if ( nb == null )
+ return na;
+
+ return new ComboValidator( na, nb );
+
+ }
+
+ public override bool Validate( object value )
+ {
+ return a.Validate( value ) || b.Validate( value );
+ }
+
+
+
+ public override object ValidateValue(object value)
+ {
+ try
+ {
+ return a.ValidateValue(value);
+ }
+ catch (Exception)
+ {
+ return b.ValidateValue(value);
+ }
+ }
+
+ public Validator A()
+ {
+ return a;
+ }
+
+ public Validator B()
+ {
+ return b;
+ }
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ComboValidator.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ComboValidator.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Direction.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Direction.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Direction.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Direction.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,37 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ /// <summary>
+ /// The direction of a message.
+ /// </summary>
+ public enum Direction
+ {
+ /// <summary>
+ /// Message is both toward client and toward server.
+ /// </summary>
+ BOTH,
+ /// <summary>
+ /// Message is toward server.
+ /// </summary>
+ SERVER,
+ /// <summary>
+ /// Message is toward client.
+ /// </summary>
+ CLIENT
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Direction.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Direction.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Field.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Field.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Field.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Field.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,35 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+
+ /// <summary>Field is an IdName which denotes a field of a struct or message (i.e., a key for a value).</summary>
+ public class Field : IdName
+ {
+ ///<summary>Constructs the Field.</summary>
+ ///<param name="id">id the id of the field.</param>
+ ///<param name="name">name the name of the field.</param>
+ public Field(int id, string name)
+ : base(id, name)
+ { }
+
+ ///<param name="name">name the name of the field.</param>
+ public Field(string name)
+ : base(name)
+ { }
+ }
+}
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Field.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Field.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/FieldMap.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/FieldMap.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/FieldMap.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/FieldMap.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,29 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ /// <summary>
+ /// FieldMap is an IdNameMap for Field
+ /// </summary>
+ public class FieldMap : IdNameMap<Field>
+ {
+ public override Field MakeNew( string name )
+ {
+ return new Field( name );
+ }
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/FieldMap.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/FieldMap.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdName.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdName.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdName.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdName.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,119 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+using System;
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ /// <summary>An IdName is a base class for Field or Type. It is used
+ /// to bind together a type or field name with the associated id. The id
+ /// is used for certain operations, such as the key in a Map, comparisons,
+ /// and binary encoding on the wire, while the name is used for display.
+ /// <see cref=""/> Field
+ /// <see cref=""/> Type</summary>
+ public class IdName
+ {
+ /// <summary>Constructs the IdName.
+ /// <param name="id">id for the name (normally computed using</param>
+ /// <param name="name"></param>
+ /// {<link>#hash(String)})</link></summary>
+ public IdName(int id, String name)
+ {
+ this.id = id;
+ this.name = name;
+ }
+
+ /// <summary>Constructs the IdName by computing the appropriate id given the name.
+ /// <param name="name"> name the name of the item.</param>
+ /// <see cref=""/> #hash(String)
+ /// </summary>
+ public IdName(string name)
+ : this(Hash(name), name)
+ { }
+
+ private readonly int id;
+
+ private readonly string name;
+
+ /// <returns>the id of the item. </returns>
+ public int Id
+ {
+ get
+ {
+ return id;
+ }
+ }
+
+ /// <returns> the name of the item.</returns>
+ public string Name
+ {
+ get
+ {
+ return name;
+ }
+ }
+
+ /// Override
+ public override string ToString()
+ {
+ return String.Format( "{0}({1})", name, id );
+ }
+
+ /// Override
+ public override bool Equals(object obj)
+ {
+ if(obj == this)
+ return true;
+
+ if(obj == null)
+ return false;
+
+ if(this.GetType() != obj.GetType())
+ return false;
+
+ IdName other = (IdName) obj;
+
+ return id.Equals( other.Id ) && name.Equals( other.Name );
+ }
+
+ /// Override
+ public override int GetHashCode()
+ {
+ return id.GetHashCode() ^ name.GetHashCode();
+ }
+
+ /// <summary>Computes the hash value of the name to be used as the id when
+ /// constructing an IdName.</summary>
+ /// <param name="name"> name the name of the type or field. </param>
+ /// <returns>a hash of name in the unicode character encoding which is
+ /// very likely to be unique over reasonable name spaces. Collisions
+ /// should be very unlikely as they will force the user to change the
+ /// name.</returns>
+ public static int Hash(String name)
+ {
+ // combination of djb2 and sdbm hash algorithm:
+ int hash = 5381;
+ int n = name.Length;
+ for(int i = 0; i < n; i++)
+ {
+ char c = name[i];
+ int h6 = hash << 6;
+ hash = (h6 << 10) + h6 - hash + c;
+ }
+ return hash;
+ }
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdName.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdName.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdNameMap.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdNameMap.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdNameMap.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdNameMap.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,181 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+using System;
+using System.Collections.Generic;
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+
+ /// <summary>Map by id and name of IdNames (or subclasses thereof).</summary>
+ /// <typeparam name="T">the specific subclass of IdName that is in the map.</typeparam>
+ public abstract class IdNameMap<T> where T : IdName
+ {
+
+ public IdNameMap()
+ {
+ // nothing to do
+ }
+
+ /// <summary>Constructs the IdNameMap.</summary>
+ /// <param name="maxAutoCount">maxAutoCount the maximum number of automatically declared IdNames
+ /// allowed. Set to 0 if you don't want any, but this may prevent working with a slightly different
+ /// version of a service.</param>
+ public IdNameMap( int maxAutoCount )
+ {
+ this.maxAutoCount = maxAutoCount;
+ }
+
+ private int maxAutoCount;
+
+ /// <summary>Gets the IdName subclass which corresponds to the specified id, or creates it if it isn't found
+ /// and if autoCount less than maxAutoCount. If created, the IdName is given the name which is
+ /// id.toString().</summary>
+ /// <param name="id">id the id of an IdName.</param>
+ /// <returns>the IdName subclass found or created.</returns>
+ public T Get( int id )
+ {
+ T t;
+
+ if (byId.TryGetValue(id, out t))
+ return t;
+
+ return null;
+ }
+
+ public T GetById( int id )
+ {
+ T t;
+
+ if (byId.TryGetValue(id, out t))
+ return t;
+
+ return null;
+ }
+
+ /// <summary>Gets the IdName subclass which corresponds to the specified name, or creates it if it isn't
+ /// found and if autoCount maxAutoCount. If created, the IdName is given the id which is
+ /// IdName.hash( name ).</summary>
+ /// <param name="name">name the name of an IdName.</param>
+ /// <returns>the IdName subclass found or created.</returns>
+ public T Get( String name )
+ {
+ T t;
+
+ if (byName.TryGetValue(name, out t))
+ return t;
+
+ if (!locked)
+ return Add( MakeNew( name ) );
+
+ return null;
+ }
+
+ public T GetByName(String name)
+ {
+ T t;
+
+ if (byName.TryGetValue(name, out t))
+ return t;
+
+ if (!locked)
+ return Add(MakeNew(name));
+
+ return null;
+ }
+
+ /// <summary>
+ /// Adds the IdName subclass to the map.
+ /// </summary>
+ /// <param name="t">the IdName subclass to add.</param>
+ /// <returns>the IdName from the map</returns>
+ /// Exception:
+ /// throws Exception (state) if there is a collision with id or name, or a collision with
+ /// id and name where they are not associated with the same object.
+ public T Add( T t )
+ {
+ if ( locked )
+ throw new Exception( "state exception -- locked" );
+
+ if ( byId.ContainsKey( t.Id ) )
+ {
+ if ( ( t.Name == "msg" ) || ( t.Name == "result" ) )
+ return t;
+
+ throw new ArgumentException( "id collision" );
+ }
+
+ if ( byName.ContainsKey( t.Name ) )
+ {
+ if ( ( t.Name == "msg" ) || ( t.Name == "result" ) )
+ return t;
+
+ throw new ArgumentException( "name collision" );
+ }
+ byId.Add ( t.Id, t);
+ byName.Add(t.Name, t);
+ return t;
+ }
+
+ /// <summary>
+ /// Adds all the IdNames to this IdNameMap
+ /// </summary>
+ /// <param name="ts"></param>
+ public void AddAll( IdNameMap<T> ts )
+ {
+ if ( locked )
+ throw new Exception( "locked" );
+
+ foreach ( T t in ts.byId.Values )
+ Add( t );
+ }
+
+ /// <summary></summary>
+ /// <returns>a snapshot collection of all the values.</returns>
+ public List<T> Values()
+ {
+ return new List<T>( byId.Values );
+ }
+
+ /// <summary>
+ /// Locks the map, preventing further changes
+ /// </summary>
+ public void Lock()
+ {
+ locked = true;
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <returns>the number of values in the map</returns>
+ public int Size()
+ {
+ return byId.Count;
+ }
+
+ /// <summary>Makes a new subclass of IdName to put in this map.</summary>
+ /// <param name="name">name the name of the new subclass of IdName.</param>
+ /// <returns>a newly constructed subclass of IdName to put in this map.</returns>
+ abstract public T MakeNew( String name );
+
+ private Dictionary<int, T> byId = new Dictionary<int, T>();
+
+ private Dictionary<String, T> byName = new Dictionary<String, T>();
+
+ private Boolean locked;
+}
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdNameMap.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/IdNameMap.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ImportExportHelper.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ImportExportHelper.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ImportExportHelper.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ImportExportHelper.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,91 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+using System;
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ /// <summary>
+ /// class used to implement ValueFactory based import / export code
+ /// for service defined types.
+ /// </summary>
+ public class ImportExportHelper
+ {
+ protected ImportExportHelper()
+ {
+ ev = delegate(ValueFactory vf, Object value)
+ {
+ throw new NotImplementedException("must override ExportValue method");
+ };
+ iv = delegate(StructValue sv)
+ {
+ throw new NotImplementedException("must override ImportValue method");
+ };
+ }
+
+ public ImportExportHelper( ExportValueDelegate ev, ImportValueDelegate iv )
+ {
+ if (ev == null)
+ throw new ArgumentNullException("ev == null");
+
+ if (iv == null)
+ throw new ArgumentNullException("iv == null");
+
+ this.ev = ev;
+ this.iv = iv;
+ }
+
+ private readonly ExportValueDelegate ev;
+
+ private readonly ImportValueDelegate iv;
+
+ /// <summary>
+ /// Exports a value by creating an equivalent StructValue.
+ /// </summary>
+ /// <param name="vf">the value factory used to export.</param>
+ /// <param name="value">a service defined type to export.</param>
+ /// <returns>a StructValue representing the exported value.</returns>
+ public virtual StructValue ExportValue( ValueFactory vf, Object value )
+ {
+ return ev( vf, value );
+ }
+
+ /// <summary>
+ /// Imports a value from an equivalent StructValue.
+ /// </summary>
+ /// <param name="sv">a StructValue representing the exported value.</param>
+ /// <returns>a service defined type.</returns>
+ public virtual Object ImportValue( StructValue sv )
+ {
+ return iv( sv );
+ }
+
+ /// <summary>
+ /// Exports a value by creating an equivalent StructValue.
+ /// </summary>
+ /// <param name="vf">the value factory to use for export.</param>
+ /// <param name="value">a service defined type to export.</param>
+ /// <returns>a StructValue representing the exported value.</returns>
+ public delegate StructValue ExportValueDelegate(ValueFactory vf, Object value);
+
+ /// <summary>
+ /// Imports a value from an equivalent StructValue.
+ /// </summary>
+ /// <param name="sv">a StructValue representing the exported value.</param>
+ /// <returns>a service defined type.</returns>
+ public delegate Object ImportValueDelegate( StructValue sv );
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ImportExportHelper.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ImportExportHelper.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Message.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Message.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Message.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Message.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,103 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ ///<summary> A message is modeled as a command and some argments. The command is an arbitrary
+ /// integer value, and the arguments are key / value pairs, where the key is an arbitrary integer
+ /// value and the value is any one of the standard C# objects, an ArrayValue, a StructValue, or any type
+ /// which may be serialized by the ValueFactory.</summary>
+ public sealed class Message : StructValue
+ {
+ ///<summary>Constructs the Message.</summary>
+ ///<param name="type">type of the message (command).</param>
+ ///<param name="vf"> vf the value factory.</param>
+ public Message(XType type, ValueFactory vf)
+ : this(type, vf, 0)
+ {
+ // nothing to do.
+ }
+
+ ///<summary>Constructs the Message.</summary>
+ ///<param name="type">type of the message (command).</param>
+ ///<param name="vf">vf the value factory.</param>
+ ///<param name="length"> the expected number of name/value pairs</param>
+ public Message(XType type, ValueFactory vf, int length)
+ : base(type, vf, length)
+ {
+ this.vf = vf;
+ }
+
+ private readonly ValueFactory vf;
+
+ ///<returns>the value factory.</returns>
+ public ValueFactory Vf
+ {
+ get
+ {
+ return vf;
+ }
+ }
+
+
+ /// <summary>Creates a message which is a reply to the current message. The current message's value
+ /// factory is copied to the new message. The message-id of the current message (if any) is copied into
+ /// the in-reply-to field of the new message.</summary>
+ /// <param name="rType"> rType the type of the reply.</param>
+ /// <returns> a reply message.</returns>
+ public Message Reply( XType rType )
+ {
+ Message rmsg = new Message( rType, vf );
+ rmsg.InReplyTo = MessageId; //rmsg.InReplyTo(GetMessageId()); changed
+ return rmsg;
+ }
+
+ public Message Reply()
+ {
+ Message rmsg = new Message( GetXType.GetResult(), vf );
+ rmsg.InReplyTo = MessageId;
+ return rmsg;
+ }
+
+ /// <returns>the connection specific unique identifier of this message, or null if there was no
+ /// such identifier.</returns>
+ public long? MessageId
+ {
+ get
+ {
+ return vf.GetMessageId(this);
+ }
+ set
+ {
+ vf.SetMessageId(this, value);
+ }
+ }
+
+ /// <returns>the message-id of the message that this is a response to. Null if this is an original message
+ /// or if the original message did not have a message-id.</returns>
+ public long? InReplyTo
+ {
+ get
+ {
+ return vf.GetInReplyTo(this);
+ }
+ set
+ {
+ vf.SetInReplyTo(this, value);
+ }
+ }
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Message.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Message.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/StructValue.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/StructValue.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/StructValue.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/StructValue.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,220 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+
+ ///A typed map of key/value pairs, where the type is a Type, each key is a Field,
+ ///and each value is of arbitrary type chosen from the basic java types boolean, byte,
+ ///short, int, long, float, double, String, an array of those, the extended types ArrayValue
+ ///and StructValue, and specific types supported by ValueFactory.
+ ///StructValue is not protected against concurrent access.
+ public class StructValue
+ {
+ ///<summary>Constructs the StructValue with default length.</summary>
+ ///<param name="type">the type of the struct (or the action or event if
+ ///this is a message).</param>
+ ///<param name="vf">the value factory for this struct</param>
+ public StructValue(XType type, ValueFactory vf)
+ : this(type, vf, 0)
+ {
+ // nothing to do.
+ }
+
+ ///<summary>Constructs the StructValue.</summary>
+ ///<param name="type">the type of the struct (or the action or event if
+ ///this is a message).</param>
+ ///<param name="length">the expected number of name/value pairs.</param>
+ public StructValue(XType type, ValueFactory vf, int length)
+ {
+ if (type == null)
+ throw new ArgumentNullException("type == null");
+
+ if (vf == null)
+ throw new ArgumentNullException("vf == null");
+
+ this.type = type;
+ this.fields = new Dictionary<Field, Object>(length > 0 ? (length * 4 + 2) / 3 : DEFAULT_SIZE);
+ this.level = vf.GetLevel();
+ }
+
+ private const int DEFAULT_SIZE = 8;
+
+ private readonly XType type;
+
+ private readonly Dictionary<Field, Object> fields;
+
+ private readonly Validator.Level level;
+
+ /// <summary>
+ /// The struct type, or message action or event.
+ /// </summary>
+ public XType GetXType
+ {
+ get
+ {
+ return type;
+ }
+ }
+
+ /// <summary>
+ /// The validation level.
+ /// </summary>
+ public Validator.Level Level
+ {
+ get
+ {
+ return level;
+ }
+ }
+
+ /// <summary>Compares the type of this struct to another type.</summary>
+ /// <param name="otherType">otherType the type to compare this type to.</param>
+ /// <returns>true if this struct is of the specified type.</returns>
+ public bool IsType(XType otherType)
+ {
+ return type.Equals(otherType);
+ }
+
+ /// <summary>Checks a struct for having the expected type.</summary>
+ /// <param name="expectedType">expectedType the expected type of this struct.</param>
+ /// Exception:
+ /// throws IllegalArgumentException if the type is not as expected.
+ public void CheckType(XType expectedType)
+ {
+ if(!IsType(expectedType))
+ throw new ArgumentException();
+ }
+
+ public Dictionary<Field, Object>.Enumerator GetEnumerator()
+ {
+ return fields.GetEnumerator();
+ }
+
+ public Dictionary<Field, Object>.KeyCollection Keys
+ {
+ get
+ {
+ return fields.Keys;
+ }
+ }
+
+ public bool ContainsKey(Field key)
+ {
+ return fields.ContainsKey(key);
+ }
+
+ /// <summary>Defined to get the Object return type</summary>
+ /// <param name="key"></param>
+ /// <returns></returns>
+ public Object Get(Field key)
+ {
+ object value;
+ return fields.TryGetValue(key, out value) ? value : null;
+ }
+
+ /// <summary>
+ /// Overriding Dictionary's Add(key, value) function
+ /// </summary>
+ /// <param name="key"></param>
+ /// <param name="value"></param>
+ public void Add(Field key, Object value)
+ {
+ if (value == null)
+ {
+ fields.Remove(key);
+ return;
+ }
+
+ if (level != Validator.Level.NONE)
+ {
+ Validator v = type.GetValidator(key);
+
+ if (v == null && level == Validator.Level.FULL)
+ throw new ArgumentException(String.Format(
+ "validator missing for type {0} field {1}", type, key));
+
+ if (v != null && !v.Validate(value))
+ throw new ArgumentException(String.Format(
+ "validator {0} failed for type {1} field {2} : value {3}",
+ v, type, key, value));
+ }
+
+ fields[key] = value;
+ }
+
+ public Object this[Field key]
+ {
+ get
+ {
+ return Get(key);
+ }
+ set
+ {
+ Add(key, value);
+ }
+ }
+
+ public void Remove(Field key)
+ {
+ fields.Remove(key);
+ }
+
+ public int Count
+ {
+ get
+ {
+ return fields.Count;
+ }
+ }
+
+ /// Override
+ public override string ToString()
+ {
+ return string.Format( "{0}: {1}", type, PrintElementsOfMap() );
+ }
+
+ /// <summary>
+ /// Utility function to print the elements of a
+ /// map like the way Java does (for hashmap).
+ /// </summary>
+ /// <returns></returns>
+ private string PrintElementsOfMap()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.Append( "{" );
+ int i = 0;
+ foreach ( KeyValuePair<Field, Object> me in this )
+ {
+ if ( i != 0 )
+ sb.Append( ", " );
+ sb.Append( me.Key );
+ sb.Append( "=" );
+ sb.Append( me.Value );
+ i++;
+ }
+
+ sb.Append( "}" );
+
+ return sb.ToString();
+ }
+
+ }
+}
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/StructValue.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/StructValue.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/TypeMap.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/TypeMap.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/TypeMap.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/TypeMap.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,29 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ /// <summary>
+ /// TypeMap is an IdNameMap for Type
+ /// </summary>
+ public class TypeMap : IdNameMap<XType>
+ {
+ public override XType MakeNew( string name )
+ {
+ return new XType( name );
+ }
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/TypeMap.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/TypeMap.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Validator.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Validator.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Validator.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Validator.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,82 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+using System;
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ /// <summary>
+ /// Validate values put into messages
+ /// </summary>
+ abstract public class Validator
+ {
+ /// <summary>
+ /// The validation level.
+ /// </summary>
+ public enum Level
+ {
+ /// <summary>
+ /// No validation on put or output.
+ /// </summary>
+ NONE,
+ /// <summary>
+ /// Validation on put or output if validator defined.
+ /// </summary>
+ MISSING_OK,
+ /// <summary>
+ /// Like MISSING_OK, but fail if no validator defined.
+ /// </summary>
+ FULL
+ }
+
+ /// <summary>
+ /// The maximum number of dimensions for arrays
+ /// </summary>
+ public const int MAX_NDIMS = 9;
+
+ /// <summary>
+ /// The maximum number of validators to cache per type.
+ /// </summary>
+ protected const int MAX_CACHED = 4;
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <returns>for an array type, return a validator for an element of
+ /// the array (which might be a scalar or another array element).</returns>
+ abstract public Validator ElementValidator();
+
+ /// <summary>
+ /// Checks the value for being valid. If the value is valid
+ /// by this validator, return true.
+ /// </summary>
+ /// <param name="value">the value to be validated.</param>
+ /// <returns>true if the value is valid by any validator in the
+ /// chain, or false if all reject it.</returns>
+ abstract public bool Validate( Object value );
+
+
+
+ /// <summary>
+ /// </summary>
+ /// <param name="value"></param>
+ /// <returns> return the appropriate value given the input value and this
+ /// validator's sensibility about what it should be really (e.g.,
+ /// input Byte but output Long. </returns>
+
+ abstract public Object ValidateValue(Object value);
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Validator.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/Validator.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ValueFactory.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ValueFactory.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ValueFactory.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ValueFactory.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,167 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ /// <summary>Interface which defines the value factory which helps
+ /// the idl compiler serialize and deserialize messages, convert values, etc.</summary>
+ public interface ValueFactory
+ {
+ //////////
+ // XType //
+ //////////
+
+ /// <summary>Translates a type id into the appropriate XType object.
+ /// If the type does not exist, and if dynamic typing is enabled,
+ /// adds it to the dynamic types.</summary>
+ ///<param> id a type id.</param>
+ /// <returns> id translated into the appropriate XType.</returns>
+ XType GetType(int id);
+
+ /// <summary>Translates a type name into the appropriate XType object.
+ /// If the type does not exist, and if dynamic typing is enabled,
+ /// adds it to the dynamic types.</summary>
+ /// <param>name a type name.</param>
+ /// <returns> name translated into the appropriate XType.</returns>
+
+ XType GetType(string name);
+
+ /// <summary>
+ /// Adds the type if it doesn't already exist. Use this to dynamically add
+ /// types to a ValueFactory. The type is per instance of the ValueFactory,
+ /// not global. Not available if dynamic typing is locked.
+ /// </summary>
+ /// <param name="type"></param>
+ void AddType(XType type);
+
+ /// <summary>
+ /// Locks the dynamic typing so that no new types may be created by addType
+ /// or getType.
+ /// </summary>
+ void LockDynamicTypes();
+
+ /// <summary>
+ /// Unlocks the dynamic typing so that new types may be created by addType
+ /// or getType.
+ /// </summary>
+ void UnlockDynamicTypes();
+
+ /// <returns> a collection of all the types.</returns>
+ ICollection<XType> GetTypes();
+
+ /////////////////////
+ // STRING ENCODING //
+ /////////////////////
+
+ ///<returns> the encoding to use for strings.
+ Encoding GetStringEncoding();
+
+ ////////////////
+ // MESSAGE ID //
+ ////////////////
+
+ /// <param name="msg">msg the message whose well-known message-id field is to be returned.</param>
+ /// <returns>the value of the well-known message-id field. This is a unique identifier
+ /// for this message on a particular transport during a particular session. If there is no well-known
+ /// message-id field defined, or if the message-id field has not been set, then return null.</returns>
+
+ long? GetMessageId(Message msg);
+
+ /// <summary> Sets the value of the well-known message-id field. This is a unique identifier
+ /// for this message on a particular transport during a particular session. If there is no
+ /// well-known message-id field defined then nothing is done. If msgid is null, then the field is cleared.
+ /// </summary>
+ /// <param>msg the message whose well-known message-id field is to be set.</param>
+ /// <param>msgid the value of the well-known message-id field.</param>
+
+ void SetMessageId(Message msg, long? msgid);
+
+ /// <summary>
+ /// Gets well-known message field for message id.
+ /// </summary>
+ /// <returns>well-known message field for message id.</returns>
+ Field Get_mf__messageId();
+
+ /////////////////
+ // IN REPLY TO //
+ /////////////////
+
+ /// <returns>the value of the in-reply-to field, or null if there is none or if there is no such field defined.
+ /// </returns>
+ ///<param> msg the message whose well-known in-reply-to field is to be returned.</param>
+
+ long? GetInReplyTo(Message msg);
+
+ /// <param>msg the message whose well-known in-reply-to field is to be set.</param>
+ /// <param>msgid the value of the well-known in-reply-to field. If there is no well-known
+ /// in-reply-to field defined then nothing is done. If msgid is null, then the field is cleared.</param>
+ /// </summary>
+
+ void SetInReplyTo(Message msg, long? msgid);
+
+ /// <summary>
+ /// Gets well-known message field for in reply to.
+ /// </summary>
+ /// <returns>well-known message field for in reply to.</returns>
+ Field Get_mf__inReplyTo();
+
+ //////////////////////
+ // VALUE CONVERSION //
+ //////////////////////
+
+ /// <summary>Converts a value to a struct value representation to be exported to a tagged data output.</summary>
+ /// <param>value a custom type defined by a service, or a well-known standard type (e.g., date).</param>
+ /// <returns> a struct value representing the value.</returns>
+ /// <throws>UnsupportedOperationException if the type cannot be exported.</throws>
+
+ StructValue ExportCustomValue(object value);
+
+ /// <summary>Converts a struct value imported from a tagged data input to a normal type.</summary>
+ /// <param>sv a struct value representation of a custom type, or a well known standard type.</param>
+ /// <returns> a custom type, or a well known standard type.</returns>
+ /// <throws> UnsupportedOperationException if the type cannot be imported.</throws>
+
+ Object ImportCustomValue(StructValue sv);
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="c">the class of a custom value.</param>
+ /// <returns>the struct type of a custom value class.</returns>
+ XType GetCustomStructType( Type c );
+
+ ///<summary></summary>
+ /// <returns>well-known message type for exception thrown by one-way message</returns>
+ XType get_mt__exception();
+
+ /// <summary>
+ /// Gets the put / write validation level.
+ /// </summary>
+ /// <returns>the put / write validation level</returns>
+ Validator.Level GetLevel();
+
+ /// <summary>
+ /// Sets the put / write validation level.
+ /// </summary>
+ /// <param name="level">the new put / write validation level</param>
+ /// <returns>the old put / write validation level</returns>
+ Validator.Level SetLevel(Validator.Level level);
+ }
+}
\ No newline at end of file
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ValueFactory.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/ValueFactory.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/XType.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/XType.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/XType.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/XType.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,338 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+using System;
+using System.Collections.Generic;
+
+namespace Org.Apache.Etch.Bindings.Csharp.Msg
+{
+ /// <summary>
+ /// Type denotes the type of a struct or message. When used with a
+ /// message it typically denotes an action or event.
+ /// </summary>
+ public class XType : IdName
+ {
+ /// <summary>Constructs the Type.</summary>
+ /// <param name="id">id of the type.</param>
+ /// <param name="name">name of the type.</param>
+ public XType( int id, String name )
+ : base( id, name )
+ {
+ // nothing else.
+ }
+
+ /// <summary>Constructs the Type, computing the appropriate value for the id.</summary>
+ /// <param name="name">name the name of the type.</param>
+ public XType( String name )
+ : base( name )
+ {
+ // nothing else.
+ }
+
+ public Validator GetValidator( Field key )
+ {
+ Validator v;
+ return validators.TryGetValue(key, out v) ? v : null;
+ }
+
+ private readonly FieldMap fieldMap = new FieldMap();
+
+ /// <summary>
+ /// Adds the validator to the chain for this key.
+ /// </summary>
+ /// <param name="key"></param>
+ /// <param name="vldtr"></param>
+ public void PutValidator( Field key, Validator vldtr )
+ {
+ CheckNotLocked();
+
+ if ( vldtr == null )
+ return;
+
+ if ( fieldMap.Get( key.Id ) == null )
+ AddField( key );
+
+ Validator v;
+ if (validators.TryGetValue(key, out v))
+ validators[key] = new ComboValidator(v, vldtr);
+ else
+ validators[key] = vldtr;
+ }
+
+ /// <summary>
+ /// Removes the validator chain for this key
+ /// </summary>
+ /// <param name="key"></param>
+ public void ClearValidator( Field key )
+ {
+ CheckNotLocked();
+ validators.Remove( key );
+ }
+
+ public Dictionary<Field, Validator> validators = new Dictionary<Field, Validator>();
+
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <returns>the result type of this message type</returns>
+ public XType GetResult()
+ {
+ return rType;
+ }
+
+ public void SetResult( XType rType )
+ {
+ CheckNotLocked();
+ this.rType = rType;
+ }
+
+ private XType rType;
+
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <returns>the associated import / export helper</returns>
+ public ImportExportHelper GetImportExportHelper()
+ {
+ return helper;
+ }
+
+ /// <summary>
+ /// Sets the associated import / export helper.
+ /// </summary>
+ /// <param name="helper"></param>
+ public void SetImportExportHelper( ImportExportHelper helper )
+ {
+ CheckNotLocked();
+ this.helper = helper;
+ }
+
+ private ImportExportHelper helper;
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <returns>the associated component type for an array of this type</returns>
+
+ public Type GetComponentType()
+ {
+ return componentType;
+ }
+
+ /// <summary>
+ /// Sets the associated component type for an array of this type.
+ /// This type is not used when de-serializing the array components,
+ /// just when allocating the array itself.
+ /// </summary>
+ /// <param name="type"></param>
+
+ public void SetComponentType(Type type)
+ {
+ CheckNotLocked();
+ this.componentType = type;
+ }
+
+ private Type componentType;
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <returns>an object to help dispatch the received message</returns>
+ public Object GetStubHelper()
+ {
+ return stubHelper;
+ }
+
+ /// <summary>
+ /// Sets an object to help the stub dispatch the received message
+ /// </summary>
+ /// <param name="stubHelper"></param>
+ public void SetStubHelper( Object stubHelper )
+ {
+ // CheckNotLocked(); called from stub and not from value factory.
+ if (this.stubHelper != null)
+ throw new Exception("this.stubHelper != null");
+ this.stubHelper = stubHelper;
+ }
+
+ private Object stubHelper;
+
+
+ ///<summary>Locks the fields for this type.</summary>
+ public void Lock()
+ {
+ locked = true;
+ fieldMap.Lock();
+ }
+
+ private void CheckNotLocked()
+ {
+ if (locked)
+ throw new Exception("locked");
+ }
+
+ private bool locked;
+
+
+ ///<summary>Adds a field to the set of fields.</summary>
+ ///<param name="field"> A field to all </param>
+ ///<returns>Returns the argument. If there is a collision with
+ /// an id and name, both associated with the same field,
+ /// then that field is returned instead of the argument </returns>
+ /// <Exception cref="ArgumentException">hrows IllegalArgumentException if there is a
+ /// collision in the id or name, or both id and name when not associated
+ /// with the same field.</Exception>
+ public Field AddField( Field field )
+ {
+ return fieldMap.Add( field );
+ }
+
+ ///<summary>Translates a field id into the appropriate Field object.</summary>
+ ///<param name="id">field id</param>
+ ///<returns>id translated into the appropriate Field.</returns>
+ public Field GetField( int id )
+ {
+ return fieldMap.Get( id );
+ }
+
+
+ ///<summary>Translates a field name into the appropriate Field.</summary>
+ ///<param name="name">A field name</param>
+ ///<returns>name translated into the appropriate Field.</returns>
+ public Field GetField( string name )
+ {
+ return fieldMap.Get( name );
+ }
+
+ ///<returns>a set of all the fields.</returns>
+ public List<Field> GetFields()
+ {
+ return fieldMap.Values();
+ }
+
+ /// <summary>
+ /// Every type ( => message) carries a timeout
+ /// </summary>
+ private int timeout;
+
+ public int Timeout
+ {
+ get
+ {
+ return timeout;
+ }
+ set
+ {
+ CheckNotLocked();
+ timeout = value;
+ }
+ }
+
+ /// <summary>
+ /// Field containing result value
+ /// </summary>
+ private Field responseField;
+
+ public Field ResponseField
+ {
+ get
+ {
+ return responseField;
+ }
+ set
+ {
+ CheckNotLocked();
+ responseField = value;
+ }
+ }
+
+ ///<summary>Checks whether this type is assignment compatible with other. This
+ ///means that other is a subclass of this.</summary>
+ ///<param name="other"></param>
+ ///<returns>true if this type is assignable from other</returns>
+
+ public bool IsAssignableFrom( XType other )
+ {
+ return other != null && ( this.Equals( other ) || IsAssignableFrom( other.SuperType() ) );
+ }
+
+ public void CheckIsAssignableFrom( XType other )
+ {
+ if ( !IsAssignableFrom( other ) )
+ throw new ArgumentOutOfRangeException();
+ }
+
+ public XType SuperType()
+ {
+ return superType;
+ }
+
+ ///<summary>Sets the super type of this type. If struct A extends B, then
+ ///B is the super type of A.</summary>
+ ///<param name="superType"></param>
+ public void SetSuperType( XType superType )
+ {
+ CheckNotLocked();
+ this.superType = superType;
+ }
+
+ private XType superType;
+
+ /// <summary>
+ /// Gets AsyncMode for this Type
+ /// </summary>
+ /// <returns>AsyncMode</returns>
+ public AsyncMode GetAsyncMode()
+ {
+ return asyncMode;
+ }
+
+ /// <summary>
+ /// Sets the AysncMode
+ /// </summary>
+ /// <param name="mode"></param>
+ public void SetAsyncMode(AsyncMode mode)
+ {
+ CheckNotLocked();
+ asyncMode = mode;
+ }
+
+ private AsyncMode asyncMode;
+
+ /// <summary>
+ /// Gets the message direction.
+ /// </summary>
+ /// <returns>the message direction</returns>
+ public Direction GetDirection()
+ {
+ return direction;
+ }
+
+ /// <summary>
+ /// Sets the message direction.
+ /// </summary>
+ /// <param name="direction"></param>
+ public void SetDirection(Direction direction)
+ {
+ CheckNotLocked();
+ this.direction = direction;
+ }
+
+ private Direction direction;
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/XType.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Msg/XType.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
Added: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/AuthExceptionSerializer.cs
URL: http://svn.apache.org/viewvc/incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/AuthExceptionSerializer.cs?rev=739432&view=auto
==============================================================================
--- incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/AuthExceptionSerializer.cs (added)
+++ incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/AuthExceptionSerializer.cs Fri Jan 30 22:25:03 2009
@@ -0,0 +1,59 @@
+// $Id$
+//
+// Copyright 2007-2008 Cisco Systems Inc.
+//
+// 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.
+
+using System;
+using Org.Apache.Etch.Bindings.Csharp.Msg;
+
+namespace Org.Apache.Etch.Bindings.Csharp.Support
+{
+ public class AuthExceptionSerializer : ImportExportHelper
+ {
+ private const String FIELD_NAME = "msg";
+
+ public static void Init(XType type, Class2TypeMap class2type)
+ {
+ Field field = type.GetField(FIELD_NAME);
+ class2type.Add(typeof(_Etch_AuthException), type);
+ type.SetComponentType(typeof(_Etch_AuthException));
+ type.SetImportExportHelper(new AuthExceptionSerializer(type, field));
+ type.PutValidator(field, Validator_string.Get(0));
+ type.Lock();
+ }
+
+ public AuthExceptionSerializer(XType type, Field field)
+ {
+ this.type = type;
+ this.field = field;
+ }
+
+ private readonly XType type;
+
+ private readonly Field field;
+
+ public override StructValue ExportValue(ValueFactory vf, Object value)
+ {
+ StructValue sv = new StructValue(type, vf);
+ sv.Add(field, value.ToString());
+ return sv;
+ }
+
+ public override Object ImportValue(StructValue sv)
+ {
+ sv.CheckType(type);
+ return new _Etch_AuthException((String)sv.Get(field));
+ }
+ }
+}
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/AuthExceptionSerializer.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/etch/trunk/binding-csharp/runtime/src/main/csharp/Org.Apache.Etch.Bindings.Csharp/Support/AuthExceptionSerializer.cs
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"