File: sshcommandfactory.h

package info (click to toggle)
molequeue 0.9.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,924 kB
  • sloc: cpp: 22,039; python: 478; xml: 364; sh: 59; makefile: 14
file content (63 lines) | stat: -rw-r--r-- 1,589 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/******************************************************************************

  This source file is part of the MoleQueue project.

  Copyright 2011-2012 Kitware, Inc.

  This source code is released under the New BSD License, (the "License").

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

******************************************************************************/

#ifndef SSHCOMMANDFACTORY_H
#define SSHCOMMANDFACTORY_H

#include "sshcommand.h"

namespace MoleQueue {

/**
 * @class SshCommandFactory sshcommandfactory.h <molequeue/sshcommandfactory.h>
 * @brief Used to construct the correct SshCommand implementation based on the
 * ssh client
 *
 * @author Chris Harris
 *
 */
class SshCommandFactory: public QObject
{
  Q_OBJECT

public:

    /// Ssh clients
    enum SshClient {
        OpenSsh
#ifdef _WIN32
        , Putty
#endif
    };

    static SshCommandFactory *instance();
    static QString defaultSshCommand();
    static QString defaultScpCommand();

    /**
     * @return a new SshCommand for this platform, the caller is responsible
     * for cleanup
     */
    SshCommand *newSshCommand(QObject *parentObject = 0);
    SshCommand *newSshCommand(SshClient sshClient, QObject *parentObject = 0);

private:
   SshCommandFactory(QObject *parentObject = 0);
};

} // End namespace

#endif