ua_job.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (C) 2014 the contributors as stated in the AUTHORS file
  3. *
  4. * This file is part of open62541. open62541 is free software: you can
  5. * redistribute it and/or modify it under the terms of the GNU Lesser General
  6. * Public License, version 3 (as published by the Free Software Foundation) with
  7. * a static linking exception as stated in the LICENSE file provided with
  8. * open62541.
  9. *
  10. * open62541 is distributed in the hope that it will be useful, but WITHOUT ANY
  11. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  13. * details.
  14. */
  15. #ifndef UA_JOB_H_
  16. #define UA_JOB_H_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. struct UA_Connection;
  21. typedef struct UA_Connection UA_Connection;
  22. struct UA_Server;
  23. typedef struct UA_Server UA_Server;
  24. /** Jobs describe work that is executed once or repeatedly in the server */
  25. typedef struct {
  26. enum {
  27. UA_JOBTYPE_NOTHING, ///< Guess what?
  28. UA_JOBTYPE_DETACHCONNECTION, ///< Detach the connection from the secure channel (but don't delete it)
  29. UA_JOBTYPE_BINARYMESSAGE_NETWORKLAYER, ///< The binary message is memory managed by the networklayer
  30. UA_JOBTYPE_BINARYMESSAGE_ALLOCATED, ///< The binary message was relocated away from the networklayer
  31. UA_JOBTYPE_METHODCALL, ///< Call the method as soon as possible
  32. UA_JOBTYPE_METHODCALL_DELAYED, ///< Call the method as soon as all previous jobs have finished
  33. } type;
  34. union {
  35. UA_Connection *closeConnection;
  36. struct {
  37. UA_Connection *connection;
  38. UA_ByteString message;
  39. } binaryMessage;
  40. struct {
  41. void *data;
  42. void (*method)(UA_Server *server, void *data);
  43. } methodCall;
  44. } job;
  45. } UA_Job;
  46. #ifdef __cplusplus
  47. } // extern "C"
  48. #endif
  49. #endif /* UA_JOB_H_ */