代码搜索结果
找到约 10,000 项符合
State Machine 的代码
state.java
/**
*协议的抽象状态
*将要为每一个状态创建一个类来实现所要求的功能.
*所有状态的类必须继承这个类并提供doIt方法的实现,
*doIt方法在主类中(Sftp.class)循环执行.
*/
public abstract class State {
//实例变量
State next_state;
//在子类中实现,提供所要求的功能
abstract S
state.cpp
//: C03:State.cpp
// From Thinking in C++, 2nd Edition
// at http://www.BruceEckel.com
// (c) Bruce Eckel 1999
// Copyright notice in Copyright.txt
// A state-transition class
#include
state.cs
#region Using directives
using System;
using System.Collections.Generic;
using System.Text;
using JobSiteStarterKit.DAL;
using System.Data;
#endregion
namespace JobSiteStarterKit.BOL
{
state.cpp
#include "State.h"
State::~State() {}
long State::GetState() const
{
return state_long;
}
void State::SetState(long s)
{
state_long = s;
}
int State::GetStateAt(int index)
{
int
state.h
#ifndef STATE_H_
#define STATE_H_
class State
{
public:
long state_long;
int proc_path;
State() {}
virtual ~State();
long GetState() const; // 得到当前状态
void SetState(long s);
state.java
package fss;
import shared.*;
import shared.Error;
import java.lang.*;
import java.util.*;
import java.io.*;
abstract public class State {
public static final int NOT_EVALUATED = -1;
p
state.cpp
#include
#include "State.h"
State::State(vector vars)
{
m_vars = vars;
}
int State::getVar(int index) const
{
return m_vars[index];
}
void State::print() const
{
cout