]> git.buserror.net Git - polintos/scott/priv.git/blob - idlcomp/languages/c++/marshall.cc
Move arrays to Util namespace, add parametric allocator.
[polintos/scott/priv.git] / idlcomp / languages / c++ / marshall.cc
1 // C++ Marshalling
2 //
3 // This software is copyright (c) 2007 Scott Wood <scott@buserror.net>.
4 // 
5 // This software is provided 'as-is', without any express or implied warranty.
6 // In no event will the authors or contributors be held liable for any damages
7 // arising from the use of this software.
8 // 
9 // Permission is hereby granted to everyone, free of charge, to use, copy,
10 // modify, prepare derivative works of, publish, distribute, perform,
11 // sublicense, and/or sell copies of the Software, provided that the above
12 // copyright notice and disclaimer of warranty be included in all copies or
13 // substantial portions of this software.
14
15 #include "c++.h"
16
17 void CPPFile::output_ifaceinfo(Interface *iface)
18 {
19         extra_newline();
20
21 #if 0
22         file << indent << "void _invoke(::System::RunTime::Array"
23                        << "< ::System::RunTime::ID> objlist,\n"
24              << indent << "             ::System::RunTime::ParamInfoBlock::Segment *segs,\n"
25              << indent << "             int nsegs);\n\n";
26 #endif
27
28         file << indent << "__attribute__((weak)) __attribute__((unused))\n"
29              << indent << "::System::RunTime::IFaceInfo _info = {\n"
30              << indent << "\t&_guid,\n"
31              << indent << "};\n";
32         
33         do_extra_newline = true;
34 }
35
36 void CPPFile::output_marshall(Struct *sym, int pass)
37 {
38         switch (pass) {
39                 case trav_nsdecl:
40                         extra_newline();
41                         
42                         file << indent << "int _marshall(::System::RunTime::GrowableArray<uint8_t, ::System::RunTime::ORBMM> &buf,\n"
43                              << indent << "              ::System::RunTime::GrowableArray< ::System::RunTime::ID, ::System::RunTime::ORBMM> &objlist,\n"
44                              << indent << "              ::System::RunTime::GrowableArray< ::System::RunTime::NewObject, ::System::RunTime::ORBMM> &newobjlist,\n"
45                              << indent << "              ::System::RunTime::ParamInfoBlock::Segment *segs,\n"
46                              << indent << "              int nsegs);\n";
47
48                         file << indent << "void _unmarshall(::System::RunTime::Array<uint8_t, ::System::RunTime::ORBMM> buf,\n"
49                              << indent << "                 ::System::RunTime::Array< ::System::_i_Object *, ::System::RunTime::ORBMM> objlist,\n"
50                              << indent << "                 ::System::RunTime::ParamInfoBlock::Segment *segs,\n"
51                              << indent << "                 int nsegs);\n";
52
53                         do_extra_newline = true;
54                         break;
55         }
56 }