mrfioc2  2.3.0
devObjCommand.cpp
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2011 Brookhaven Science Associates, as Operator of
3 * Brookhaven National Laboratory.
4 * mrfioc2 is distributed subject to a Software License Agreement found
5 * in file LICENSE that is included with this distribution.
6 \*************************************************************************/
7 /*
8  * Author: Michael Davidsaver <mdavidsaver@gmail.com>
9  */
10 
11 #include <boRecord.h>
12 
13 #include "devObj.h"
14 
15 using namespace mrf;
16 
17 static
18 long exec_bo(boRecord *prec)
19 {
20  if (!prec->dpvt) {(void)recGblSetSevr(prec, COMM_ALARM, INVALID_ALARM); return -1; }
21  CurrentRecord cur(prec);
22  try {
23  addr<void> *priv=(addr<void>*)prec->dpvt;
24  {
25  scopedLock<mrf::Object> g(*priv->O);
26  priv->P->exec();
27  }
28  return 0;
29  }CATCH(S_dev_badArgument)
30 }
31 
32 OBJECT_DSET(BOCommand,
33  (&add_record_out<boRecord,void>),
34  &del_record_property,
35  &init_record_empty,
36  &exec_bo,
37  NULL);
38 
39 #include <epicsExport.h>
40 extern "C" {
41  OBJECT_DSET_EXPORT(BOCommand);
42 }
OBJECT_DSET_EXPORT(BOCommand)
Definition: devObj.h:97
OBJECT_DSET(BOCommand,(&add_record_out< boRecord, void >), &del_record_property, &init_record_empty, &exec_bo, NULL)
mrf::Object * O
Definition: devObj.h:90
mrf::auto_ptr< mrf::property< T > > P
Definition: devObj.h:98
#define CATCH(RET)
Definition: devObj.h:31
Definition: flash.cpp:23