annotate libinterp/corefcn/procstream.h @ 20654:b65888ec820e draft default tip gccjit

dmalcom gcc jit import
author Stefan Mahr <dac922@gmx.de>
date Fri, 27 Feb 2015 16:59:36 +0100
parents 1663b82bd009
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17787
diff changeset
3 Copyright (C) 1993-2015 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6316
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6316
diff changeset
10 option) any later version.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6316
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6316
diff changeset
19 <http://www.gnu.org/licenses/>.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22
383
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 240
diff changeset
23 #if !defined (octave_procstream_h)
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 240
diff changeset
24 #define octave_procstream_h 1
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
25
20123
1663b82bd009 Stop "implicit instantiation of undefined template" error (bug #44818).
Mike Miller <mtmiller@octave.org>
parents: 19731
diff changeset
26 #include <istream>
1663b82bd009 Stop "implicit instantiation of undefined template" error (bug #44818).
Mike Miller <mtmiller@octave.org>
parents: 19731
diff changeset
27 #include <ostream>
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
28 #include <string>
2095
36903d507b0e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents: 1996
diff changeset
29
36903d507b0e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents: 1996
diff changeset
30 #include <sys/types.h>
36903d507b0e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents: 1996
diff changeset
31
36903d507b0e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents: 1996
diff changeset
32 #include "oct-procbuf.h"
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
33
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
34 class
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5307
diff changeset
35 OCTINTERP_API
3544
71bd2d124119 [project @ 2000-02-02 21:02:31 by jwe]
jwe
parents: 3537
diff changeset
36 procstreambase : virtual public std::ios
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
37 {
1380
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
38 public:
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
39
11584
cda4aa780d58 Another round of initialising members in the constructor initialisation list
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents: 11523
diff changeset
40 procstreambase (void) : pb () { pb_init (); }
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
41
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
42 procstreambase (const std::string& name, int mode);
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
43
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
44 procstreambase (const char *name, int mode);
1380
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
45
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
46 ~procstreambase (void) { close (); }
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
47
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
48 void open (const std::string& name, int mode)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
49 { open (name.c_str (), mode); }
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
50
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
51 void open (const char *name, int mode);
1380
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
52
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
53 int is_open (void) const { return pb.is_open (); }
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
54
483
41a70d08c1f7 [project @ 1994-06-30 18:30:21 by jwe]
jwe
parents: 453
diff changeset
55 int close (void);
1380
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
56
6316
a3a2580435c2 [project @ 2007-02-16 07:23:49 by jwe]
jwe
parents: 6109
diff changeset
57 pid_t pid (void) const { return pb.pid (); }
a3a2580435c2 [project @ 2007-02-16 07:23:49 by jwe]
jwe
parents: 6109
diff changeset
58
a3a2580435c2 [project @ 2007-02-16 07:23:49 by jwe]
jwe
parents: 6109
diff changeset
59 int file_number (void) const { return pb.file_number (); }
2095
36903d507b0e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents: 1996
diff changeset
60
1380
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
61 private:
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
62
2095
36903d507b0e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents: 1996
diff changeset
63 octave_procbuf pb;
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
64
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
65 void pb_init (void) { init (&pb); }
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
66
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
67 procstreambase (const procstreambase&);
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
68
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
69 procstreambase& operator = (const procstreambase&);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
70 };
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
71
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
72 class
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5307
diff changeset
73 OCTINTERP_API
3775
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
74 iprocstream : public std::istream, public procstreambase
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
75 // iprocstream : public procstreambase, public std::istream
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
76 {
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
77 public:
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
78
3775
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
79 iprocstream (void) : std::istream (0), procstreambase () { }
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
80
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
81 iprocstream (const std::string& name, int mode = std::ios::in)
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
82 : std::istream (0), procstreambase (name, mode) { }
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
83
3544
71bd2d124119 [project @ 2000-02-02 21:02:31 by jwe]
jwe
parents: 3537
diff changeset
84 iprocstream (const char *name, int mode = std::ios::in)
3775
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
85 : std::istream (0), procstreambase (name, mode) { }
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
86
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
87 ~iprocstream (void) { }
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
88
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
89 void open (const std::string& name, int mode = std::ios::in)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
90 { procstreambase::open (name, mode); }
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
91
3544
71bd2d124119 [project @ 2000-02-02 21:02:31 by jwe]
jwe
parents: 3537
diff changeset
92 void open (const char *name, int mode = std::ios::in)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
93 { procstreambase::open (name, mode); }
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
94
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
95 private:
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
96
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
97 iprocstream (const iprocstream&);
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
98
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
99 iprocstream& operator = (const iprocstream&);
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
100 };
1448
067f11a46742 [project @ 1995-09-20 03:41:58 by jwe]
jwe
parents: 1380
diff changeset
101
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
102 class
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5307
diff changeset
103 OCTINTERP_API
3775
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
104 oprocstream : public std::ostream, public procstreambase
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
105 // oprocstream : public procstreambase, public std::ostream
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
106 {
1380
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
107 public:
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11584
diff changeset
108
3775
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
109 oprocstream (void) : std::ostream (0), procstreambase () { }
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
110
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
111 oprocstream (const std::string& name, int mode = std::ios::out)
14861
f7afecdd87ef maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
112 : std::ostream (0), procstreambase (name, mode) { }
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
113
3544
71bd2d124119 [project @ 2000-02-02 21:02:31 by jwe]
jwe
parents: 3537
diff changeset
114 oprocstream (const char *name, int mode = std::ios::out)
14861
f7afecdd87ef maint: Use Octave coding conventions for cuddling parentheses in src/ directory
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
115 : std::ostream (0), procstreambase (name, mode) { }
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
116
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
117 ~oprocstream (void) { }
1380
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
118
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
119 void open (const std::string& name, int mode = std::ios::out)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
120 { procstreambase::open (name, mode); }
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
121
3544
71bd2d124119 [project @ 2000-02-02 21:02:31 by jwe]
jwe
parents: 3537
diff changeset
122 void open (const char *name, int mode = std::ios::out)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
123 { procstreambase::open (name, mode); }
1380
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
124
79f80c6229be [project @ 1995-09-12 07:03:33 by jwe]
jwe
parents: 1315
diff changeset
125 private:
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
126
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
127 oprocstream (const oprocstream&);
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
128
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
129 oprocstream& operator = (const oprocstream&);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
130 };
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
131
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
132 class
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5307
diff changeset
133 OCTINTERP_API
3775
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
134 procstream : public std::iostream, public procstreambase
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
135 // procstream : public procstreambase, public std::iostream
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
136 {
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
137 public:
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
138
3775
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
139 procstream (void) : std::iostream (0), procstreambase () { }
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
140
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
141 procstream (const std::string& name, int mode)
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
142 : std::iostream (0), procstreambase (name, mode) { }
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
143
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
144 procstream (const char *name, int mode)
3775
13905c3a24af [project @ 2001-02-06 01:56:59 by jwe]
jwe
parents: 3652
diff changeset
145 : std::iostream (0), procstreambase (name, mode) { }
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
146
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
147 ~procstream (void) { }
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
148
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
149 void open (const std::string& name, int mode)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
150 { procstreambase::open (name, mode); }
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3775
diff changeset
151
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
152 void open (const char *name, int mode)
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
153 { procstreambase::open (name, mode); }
1965
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
154
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
155 private:
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
156
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
157 procstream (const procstream&);
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
158
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
159 procstream& operator = (const procstream&);
01e3ed56c415 [project @ 1996-02-17 02:02:50 by jwe]
jwe
parents: 1884
diff changeset
160 };
1448
067f11a46742 [project @ 1995-09-20 03:41:58 by jwe]
jwe
parents: 1380
diff changeset
161
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
162 #endif