Subversion Repositories gelsvn

Rev

Rev 563 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 563 Rev 597
Line -... Line 1...
-
 
1
/* ----------------------------------------------------------------------- *
-
 
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
-
 
3
 * Copyright (C) the authors and DTU Informatics
-
 
4
 * For license and list of authors, see ../../doc/intro.pdf
-
 
5
 * ----------------------------------------------------------------------- */
-
 
6
 
1
/**
7
/**
2
 * @file   Console.h
8
 * @file   Console.h
3
 * @author Anders Wang Kristensen <awk@imm.dtu.dk>
9
 * @author Anders Wang Kristensen <awk@imm.dtu.dk>
4
 * @date   Fri Oct 22 18:32:06 2011
10
 * @date   Fri Oct 22 18:32:06 2011
5
 *
11
 *
Line 477... Line 483...
477
 
483
 
478
    void reg(Console& cs,
484
    void reg(Console& cs,
479
        const std::string& name,
485
        const std::string& name,
480
        const std::string& help)
486
        const std::string& help)
481
    {
487
    {
-
 
488
        if(m_set_cmd.get_console() == 0)
-
 
489
        {
482
        m_print_cmd.reg(cs, name,
490
            m_print_cmd.reg(cs, name,
483
            std::bind(&variable::print_value, this), help);
491
                            std::bind(&variable::print_value, this), help);
484
 
492
            
485
        m_set_cmd.reg<T>(cs, name,
493
            m_set_cmd.reg<T>(cs, name,
486
            std::bind(&variable::set_value, this, std::placeholders::_1),
494
                             std::bind(&variable::set_value, this, std::placeholders::_1),
487
            help);
495
                             help);
-
 
496
        }
488
    }
497
    }
489
 
498
 
490
    const variable& operator=(const T& value) { m_value = value; return *this; }
499
    const variable& operator=(const T& value) { m_value = value; return *this; }
491
 
500
 
492
    operator const T&() const { return m_value; }
501
    operator const T&() const { return m_value; }