Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
b83aee75
Commit
b83aee75
authored
Aug 14, 2008
by
Jon Skeet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix AbstractMessage and AbstractBuilder to get the explicit interface implementation sorted
parent
621bb698
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
74 deletions
+65
-74
AbstractBuilder.cs
csharp/ProtocolBuffers/AbstractBuilder.cs
+40
-64
AbstractMessage.cs
csharp/ProtocolBuffers/AbstractMessage.cs
+14
-3
GeneratedExtension.cs
csharp/ProtocolBuffers/GeneratedExtension.cs
+1
-4
GeneratedMessage.cs
csharp/ProtocolBuffers/GeneratedMessage.cs
+10
-3
No files found.
csharp/ProtocolBuffers/AbstractBuilder.cs
View file @
b83aee75
...
...
@@ -10,44 +10,55 @@ namespace Google.ProtocolBuffers {
/// Implementation of the non-generic IMessage interface as far as possible.
/// </summary>
public
abstract
class
AbstractBuilder
:
IBuilder
{
public
bool
Initialized
{
get
{
throw
new
NotImplementedException
();
}
}
public
IDictionary
<
FieldDescriptor
,
object
>
AllFields
{
get
{
throw
new
NotImplementedException
();
}
#
region
Unimplemented
members
of
IBuilder
public
abstract
bool
Initialized
{
get
;
}
public
abstract
IDictionary
<
FieldDescriptor
,
object
>
AllFields
{
get
;
}
public
abstract
object
this
[
FieldDescriptor
field
]
{
get
;
set
;
}
public
abstract
MessageDescriptor
DescriptorForType
{
get
;
}
public
abstract
int
GetRepeatedFieldCount
(
FieldDescriptor
field
);
public
abstract
object
this
[
FieldDescriptor
field
,
int
index
]
{
get
;
set
;
}
public
abstract
bool
HasField
(
FieldDescriptor
field
);
#
endregion
#
region
New
abstract
methods
to
be
overridden
by
implementations
,
allow
explicit
interface
implementation
protected
abstract
IMessage
BuildImpl
();
protected
abstract
IMessage
BuildPartialImpl
();
protected
abstract
IBuilder
CloneImpl
();
protected
abstract
IMessage
DefaultInstanceForTypeImpl
{
get
;
}
protected
abstract
IBuilder
NewBuilderForFieldImpl
<
TField
>(
FieldDescriptor
field
);
protected
abstract
IBuilder
ClearFieldImpl
();
protected
abstract
IBuilder
AddRepeatedFieldImpl
(
FieldDescriptor
field
,
object
value
);
#
endregion
#
region
Methods
simply
proxying
to
the
"Impl"
methods
,
explicitly
implementing
IBuilder
IMessage
IBuilder
.
Build
()
{
return
BuildImpl
();
}
IMessage
IBuilder
.
BuildPartial
()
{
return
BuildPartialImpl
();
}
public
object
this
[
FieldDescriptor
field
]
{
get
{
throw
new
NotImplementedException
();
}
set
{
throw
new
NotImplementedException
();
}
public
IBuilder
Clone
()
{
return
CloneImpl
();
}
public
MessageDescriptor
Descriptor
ForType
{
get
{
throw
new
NotImplementedException
()
;
}
public
IMessage
DefaultInstance
ForType
{
get
{
return
DefaultInstanceForTypeImpl
;
}
}
public
int
GetRepeatedFieldCount
(
FieldDescriptor
field
)
{
throw
new
NotImplementedException
(
);
public
IBuilder
NewBuilderForField
<
TField
>
(
FieldDescriptor
field
)
{
return
NewBuilderForFieldImpl
<
TField
>(
field
);
}
public
object
this
[
FieldDescriptor
field
,
int
index
]
{
get
{
throw
new
NotImplementedException
();
}
set
{
throw
new
NotImplementedException
();
}
public
IBuilder
ClearField
(
FieldDescriptor
field
)
{
return
ClearFieldImpl
();
}
public
bool
HasField
(
FieldDescriptor
field
)
{
throw
new
NotImplementedException
(
);
public
IBuilder
AddRepeatedField
(
FieldDescriptor
field
,
object
value
)
{
return
AddRepeatedFieldImpl
(
field
,
value
);
}
#
endregion
public
IBuilder
Clear
()
{
foreach
(
FieldDescriptor
field
in
AllFields
.
Keys
)
{
...
...
@@ -95,18 +106,6 @@ namespace Google.ProtocolBuffers {
return
this
;
}
public
IMessage
Build
()
{
throw
new
NotImplementedException
();
}
public
IMessage
BuildPartial
()
{
throw
new
NotImplementedException
();
}
public
IBuilder
Clone
()
{
throw
new
NotImplementedException
();
}
public
IBuilder
MergeFrom
(
CodedInputStream
input
)
{
return
MergeFrom
(
input
,
ExtensionRegistry
.
Empty
);
}
...
...
@@ -118,22 +117,6 @@ namespace Google.ProtocolBuffers {
return
this
;
}
public
IMessage
DefaultInstanceForType
{
get
{
throw
new
NotImplementedException
();
}
}
public
IBuilder
NewBuilderForField
<
TField
>(
FieldDescriptor
field
)
{
throw
new
NotImplementedException
();
}
public
IBuilder
ClearField
(
FieldDescriptor
field
)
{
throw
new
NotImplementedException
();
}
public
IBuilder
AddRepeatedField
(
FieldDescriptor
field
,
object
value
)
{
throw
new
NotImplementedException
();
}
public
IBuilder
MergeUnknownFields
(
UnknownFieldSet
unknownFields
)
{
UnknownFields
=
UnknownFieldSet
.
CreateBuilder
(
UnknownFields
)
.
MergeFrom
(
unknownFields
)
...
...
@@ -141,14 +124,7 @@ namespace Google.ProtocolBuffers {
return
this
;
}
public
UnknownFieldSet
UnknownFields
{
get
{
throw
new
NotImplementedException
();
}
set
{
throw
new
NotImplementedException
();
}
}
public
UnknownFieldSet
UnknownFields
{
get
;
set
;
}
public
IBuilder
MergeFrom
(
ByteString
data
)
{
CodedInputStream
input
=
data
.
CreateCodedInput
();
...
...
csharp/ProtocolBuffers/AbstractMessage.cs
View file @
b83aee75
...
...
@@ -40,9 +40,20 @@ namespace Google.ProtocolBuffers {
public
abstract
int
GetRepeatedFieldCount
(
FieldDescriptor
field
);
public
abstract
object
this
[
FieldDescriptor
field
,
int
index
]
{
get
;
}
public
abstract
UnknownFieldSet
UnknownFields
{
get
;
}
// FIXME
IMessage
IMessage
.
DefaultInstanceForType
{
get
{
return
null
;
}
}
IBuilder
IMessage
.
CreateBuilderForType
()
{
return
null
;
}
#
endregion
#
region
New
abstract
methods
to
be
overridden
by
implementations
,
allow
explicit
interface
implementation
protected
abstract
IMessage
DefaultInstanceForTypeImpl
{
get
;
}
protected
abstract
IBuilder
CreateBuilderForTypeImpl
();
#
endregion
#
region
Methods
simply
proxying
to
the
"Impl"
methods
,
explicitly
implementing
IMessage
IMessage
IMessage
.
DefaultInstanceForType
{
get
{
return
DefaultInstanceForTypeImpl
;
}
}
IBuilder
IMessage
.
CreateBuilderForType
()
{
return
CreateBuilderForTypeImpl
();
}
#
endregion
public
bool
IsInitialized
{
...
...
csharp/ProtocolBuffers/GeneratedExtension.cs
View file @
b83aee75
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.Descriptors
;
namespace
Google.ProtocolBuffers
{
...
...
csharp/ProtocolBuffers/GeneratedMessage.cs
View file @
b83aee75
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
Google.ProtocolBuffers.Descriptors
;
using
Google.ProtocolBuffers.FieldAccess
;
...
...
@@ -22,12 +21,20 @@ namespace Google.ProtocolBuffers {
get
{
return
InternalFieldAccessors
.
Descriptor
;
}
}
protected
override
IMessage
DefaultInstanceForTypeImpl
{
get
{
return
DefaultInstanceForType
;
}
}
protected
override
IBuilder
CreateBuilderForTypeImpl
()
{
return
CreateBuilderForType
();
}
public
IMessage
<
TMessage
>
DefaultInstanceForType
{
get
{
throw
new
System
.
NotImplementedException
();
}
get
{
throw
new
NotImplementedException
();
}
}
public
IBuilder
<
TMessage
>
CreateBuilderForType
()
{
throw
new
System
.
NotImplementedException
();
throw
new
NotImplementedException
();
}
private
IDictionary
<
FieldDescriptor
,
Object
>
GetMutableFieldMap
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment