Skip to content

Commit 4403e6a

Browse files
committedJun 21, 2018
* enhance: [doc] One builder example more
1 parent bfdab5c commit 4403e6a

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed
 

‎41-Builder2/CdmMessages.proto

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package CdmVC;
2+
3+
enum CdmMessageType
4+
{
5+
eAdded = 0;
6+
eChanged = 1;
7+
eRemoved = 2;
8+
eList = 3;
9+
eRequestList = 4;
10+
}
11+
12+
enum DeviceType
13+
{
14+
eRecordable = 1;
15+
ePlayable = 2;
16+
eCapturable = 4;
17+
}
18+
19+
message Device
20+
{
21+
optional string name = 1;
22+
optional string id = 2;
23+
optional DeviceType type = 3;
24+
}
25+
26+
message CompositeDevice
27+
{
28+
optional string name = 1;
29+
optional string id = 2;
30+
optional string vendorId = 3;
31+
optional string productId = 4;
32+
optional string hardwareId = 5;
33+
repeated Device devices = 6;
34+
}
35+
36+
message CdmMessage
37+
{
38+
required CdmMessageType type = 1;
39+
repeated CompositeDevice devices = 2;
40+
}

‎41-Builder2/SConstruct

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
env = Environment()
2+
3+
def my_emitter( env, target, source ):
4+
# data = str(source[0])
5+
# target = []
6+
# source[0].split( '.', 1)
7+
#print 'source' + str( source[0] )
8+
name = 'asdas'
9+
target.append( File( name + '.pb.h' ) )
10+
target.append( File( name + '.pb.cc' ) )
11+
#print 'target: -|' + str( target[0] ) +'|-'
12+
#print 'target' + target[1]
13+
return ( target, source )
14+
15+
env = Environment()
16+
17+
proto_c = Builder( action = 'protoc-2.6.1.exe -I=. --cpp_out=. $SOURCE', emitter = my_emitter, src_suffix = '.proto' )
18+
env.Append( BUILDERS = {'ProtoC' : proto_c } )
19+
env.ProtoC( source = 'CdmMessages' )
20+
21+
#env.Command( ['CdmMessages.pb.h','CdmMessages.pb.cc'], 'CdmMessages.proto', 'protoc -I=. --cpp_out=. CdmMessages.proto', chdir = 1 )

‎readme.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
- Status:
44
- Ready for use
55

6+
- Description
7+
- Scons by very simple examples
8+
69
- Key Features:
710
- Average example size ~230 bytes
811
- One example cover only one feature
12+
- Fully functional examples

‎tmp/unsorted.zip

375 KB
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.