/[svn]/linuxsampler/trunk/src/network/lscpresultset.h
ViewVC logotype

Annotation of /linuxsampler/trunk/src/network/lscpresultset.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 120 - (hide annotations) (download) (as text)
Sat Jun 12 07:29:37 2004 UTC (19 years, 10 months ago) by senkov
File MIME type: text/x-c++hdr
File size: 2584 byte(s)
* Error handling in resultset class, rewrite lscpserver to use resultset.

1 senkov 113 /***************************************************************************
2     * *
3     * LinuxSampler - modular, streaming capable sampler *
4     * *
5     * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6     * *
7     * This program is free software; you can redistribute it and/or modify *
8     * it under the terms of the GNU General Public License as published by *
9     * the Free Software Foundation; either version 2 of the License, or *
10     * (at your option) any later version. *
11     * *
12     * This program is distributed in the hope that it will be useful, *
13     * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15     * GNU General Public License for more details. *
16     * *
17     * You should have received a copy of the GNU General Public License *
18     * along with this program; if not, write to the Free Software *
19     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
20     * MA 02111-1307 USA *
21     ***************************************************************************/
22    
23     #ifndef __LSCPRESULTSET_H_
24     #define __LSCPRESULTSET_H_
25 senkov 120 #include <iostream>
26     #include <sstream>
27     #include <string>
28 senkov 113 #include "../Sampler.h"
29     #include "../common/global.h"
30 senkov 120 #include "../common/LinuxSamplerException.h"
31 senkov 113
32     using namespace LinuxSampler;
33    
34     /**
35     * Helper class for producing result sets
36     */
37     class LSCPResultSet {
38     public:
39 senkov 120 LSCPResultSet(int index = -1);
40     LSCPResultSet(String, int index = -1);
41 senkov 113 void Add(String);
42     void Add(String, String);
43     void Add(String, float);
44     void Add(String, int);
45 senkov 120 void Add(int);
46     void Error(String message = "Undefined Error", int code = 0);
47     void Error(LinuxSamplerException e);
48     void Warning(String message = "Undefined Warning", int code = 0);
49 senkov 113 String Produce(void);
50    
51     private:
52     String storage;
53     int count;
54 senkov 120 int result_type;
55     int result_index;
56    
57     template<class T> inline String ToString(T o) {
58     std::stringstream ss;
59     ss << o;
60     return ss.str();
61     }
62 senkov 113 };
63    
64     #endif // __LSCPRESULTSET_H_

  ViewVC Help
Powered by ViewVC