Annotation of nono/vm/event.cpp, revision 1.1.1.7

1.1       root        1: //
                      2: // nono
1.1.1.4   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
1.1.1.7 ! root        7: //
        !             8: // イベント
        !             9: //
        !            10: 
1.1       root       11: #include "event.h"
1.1.1.3   root       12: #include "scheduler.h"
1.1       root       13: 
                     14: // コンストラクタ
                     15: Event::Event()
                     16: {
                     17: }
                     18: 
1.1.1.6   root       19: // コンストラクタ (dev 指定あり)
                     20: Event::Event(Device *dev_)
                     21:        : Event()
                     22: {
                     23:        dev = dev_;
                     24: }
                     25: 
1.1       root       26: // デストラクタ
                     27: Event::~Event()
                     28: {
                     29: }
1.1.1.2   root       30: 
1.1.1.7 ! root       31: // イベントを登録する
1.1.1.3   root       32: void
1.1.1.7 ! root       33: Event::Regist()
1.1.1.3   root       34: {
1.1.1.7 ! root       35:        gScheduler->RegistEvent(*this);
1.1.1.3   root       36: }
                     37: 
1.1.1.7 ! root       38: // 名前をセットして、イベントを登録する (便利関数)
1.1.1.3   root       39: void
1.1.1.7 ! root       40: Event::Regist(const std::string& name_)
1.1.1.3   root       41: {
1.1.1.7 ! root       42:        SetName(name_);
        !            43:        Regist();
1.1.1.3   root       44: }
                     45: 
1.1.1.2   root       46: // 名前をセットする
                     47: void
                     48: Event::SetName(const std::string& val)
                     49: {
                     50:        name = val;
                     51:        if (name.length() > 25) {
1.1.1.5   root       52:                dev->putmsgn("Event Name \"%s\" is too long(%d chars)",
1.1.1.2   root       53:                        name.c_str(), (int)name.length());
                     54:                name.resize(25);
                     55:        }
                     56: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.